2
0

🚸 (engine) Improve engine v2 client loading and timings

Client actions are triggered after the correct bubble block. If the send message request is longer than 1s we show a loading chunk

Closes #276
This commit is contained in:
Baptiste Arnaud
2023-01-27 10:54:59 +01:00
parent a738897dbb
commit 4f78dda640
16 changed files with 408 additions and 262 deletions

View File

@@ -8,7 +8,7 @@ import { LogicBlock, LogicBlockType, SessionState } from 'models'
import { ExecuteLogicResponse } from '../../types'
export const executeLogic =
(state: SessionState) =>
(state: SessionState, lastBubbleBlockId?: string) =>
async (block: LogicBlock): Promise<ExecuteLogicResponse> => {
switch (block.type) {
case LogicBlockType.SET_VARIABLE:
@@ -16,12 +16,12 @@ export const executeLogic =
case LogicBlockType.CONDITION:
return executeCondition(state, block)
case LogicBlockType.REDIRECT:
return executeRedirect(state, block)
return executeRedirect(state, block, lastBubbleBlockId)
case LogicBlockType.CODE:
return executeCode(state, block)
return executeCode(state, block, lastBubbleBlockId)
case LogicBlockType.TYPEBOT_LINK:
return executeTypebotLink(state, block)
case LogicBlockType.WAIT:
return executeWait(state, block)
return executeWait(state, block, lastBubbleBlockId)
}
}