2
0

🐛 (calCom) Fix book callback not working on second attempt

This commit is contained in:
Baptiste Arnaud
2024-05-23 15:37:44 +02:00
parent 10cbf4dfbc
commit c2f3c9709f

View File

@ -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({