diff --git a/packages/forge/blocks/calCom/actions/bookEvent.ts b/packages/forge/blocks/calCom/actions/bookEvent.ts index c973d3126..8db4adcb2 100644 --- a/packages/forge/blocks/calCom/actions/bookEvent.ts +++ b/packages/forge/blocks/calCom/actions/bookEvent.ts @@ -49,14 +49,20 @@ export const bookEvent = createAction({ parseFunction: () => { return { args: {}, - content: `Cal("on", { - action: "bookingSuccessful", - callback: (e) => { - if(window.calComBooked) return + content: `{ + const callback = (e) => { continueFlow(e.detail.data.date) - window.calComBooked = true + Cal("off", { + action: "bookingSuccessful", + callback + }) } - })`, + + Cal("on", { + action: "bookingSuccessful", + callback + }) + }`, } }, }, @@ -107,8 +113,6 @@ export const bookEvent = createAction({ }; })(window, baseUrl + "/embed/embed.js", "init"); - window.calComBooked = false; - Cal("init", { origin: baseUrl }); const location = phone ? JSON.stringify({