2
0

🐛 (calCom) Make sure Cal.com book event is emitted once per block

This commit is contained in:
Baptiste Arnaud
2024-02-06 16:08:08 +01:00
parent 9a36281f50
commit 83231e6f13

View File

@@ -47,7 +47,9 @@ export const bookEvent = createAction({
content: `Cal("on", { content: `Cal("on", {
action: "bookingSuccessful", action: "bookingSuccessful",
callback: (e) => { callback: (e) => {
if(window.calComBooked) return
continueFlow(e.detail.data.date) continueFlow(e.detail.data.date)
window.calComBooked = true
} }
})`, })`,
} }
@@ -98,6 +100,9 @@ export const bookEvent = createAction({
p(cal, ar); p(cal, ar);
}; };
})(window, baseUrl + "/embed/embed.js", "init"); })(window, baseUrl + "/embed/embed.js", "init");
window.calComBooked = false;
Cal("init", { origin: baseUrl }); Cal("init", { origin: baseUrl });
const location = phone ? JSON.stringify({ const location = phone ? JSON.stringify({