🐛 (calCom) Make sure Cal.com book event is emitted once per block
This commit is contained in:
@@ -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({
|
||||||
|
|||||||
Reference in New Issue
Block a user