2
0

(wait) Add pause option on Wait block

Closes #751
This commit is contained in:
Baptiste Arnaud
2023-09-04 14:52:16 +02:00
parent 66dc570527
commit 111fb323b1
16 changed files with 672 additions and 589 deletions

View File

@ -39,7 +39,10 @@ export const executeClientSideAction = async ({
return executeRedirect(clientSideAction.redirect)
}
if ('wait' in clientSideAction) {
return executeWait(clientSideAction.wait)
await executeWait(clientSideAction.wait)
return clientSideAction.expectsDedicatedReply
? { replyToSend: undefined }
: undefined
}
if ('setVariable' in clientSideAction) {
return executeSetVariable(clientSideAction.setVariable.scriptToExecute)

View File

@ -4,6 +4,7 @@ import { LogicBlockType } from './enums'
export const waitOptionsSchema = z.object({
secondsToWaitFor: z.string().optional(),
shouldPause: z.boolean().optional(),
})
export const waitBlockSchema = blockBaseSchema.merge(

View File

@ -177,6 +177,7 @@ const startPropsToInjectSchema = z.object({
const clientSideActionSchema = z
.object({
lastBubbleBlockId: z.string().optional(),
expectsDedicatedReply: z.boolean().optional(),
})
.and(
z