2
0

🐛 (whatsapp) Fix preview failing to start and wait timeo…

This commit is contained in:
Baptiste Arnaud
2023-09-27 16:45:14 +02:00
parent 99b0025a66
commit e10a506c96
5 changed files with 110 additions and 49 deletions

View File

@ -7,22 +7,21 @@ export const executeWait = (
block: WaitBlock
): ExecuteLogicResponse => {
const { variables } = state.typebotsQueue[0].typebot
if (!block.options.secondsToWaitFor)
return { outgoingEdgeId: block.outgoingEdgeId }
const parsedSecondsToWaitFor = safeParseInt(
parseVariables(variables)(block.options.secondsToWaitFor)
)
return {
outgoingEdgeId: block.outgoingEdgeId,
clientSideActions: parsedSecondsToWaitFor
? [
{
wait: { secondsToWaitFor: parsedSecondsToWaitFor },
expectsDedicatedReply: block.options.shouldPause,
},
]
: undefined,
clientSideActions:
parsedSecondsToWaitFor || block.options.shouldPause
? [
{
wait: { secondsToWaitFor: parsedSecondsToWaitFor ?? 0 },
expectsDedicatedReply: block.options.shouldPause,
},
]
: undefined,
}
}