diff --git a/web/lib/wrappers/crisp-wrapper.tsx b/web/lib/wrappers/crisp-wrapper.tsx index d2771abd8..85f62ba3c 100644 --- a/web/lib/wrappers/crisp-wrapper.tsx +++ b/web/lib/wrappers/crisp-wrapper.tsx @@ -21,16 +21,18 @@ const CrispWrapper: FC = (props) => { if (typeof window && user?.email) { window.$crisp = []; window.CRISP_WEBSITE_ID = process.env.NEXT_PUBLIC_CRISP_ID; - (function () { - const d = document; - const s = d.createElement("script"); - s.src = "https://client.crisp.chat/l.js"; - s.async = true; - d.getElementsByTagName("head")[0].appendChild(s); - window.$crisp.push(["set", "user:email", [user.email]]); - window.$crisp.push(["do", "chat:hide"]); - window.$crisp.push(["do", "chat:close"]); - })(); + if (window.CRISP_WEBSITE_ID != null) { + (function () { + const d = document; + const s = d.createElement("script"); + s.src = "https://client.crisp.chat/l.js"; + s.async = true; + d.getElementsByTagName("head")[0].appendChild(s); + window.$crisp.push(["set", "user:email", [user.email]]); + window.$crisp.push(["do", "chat:hide"]); + window.$crisp.push(["do", "chat:close"]); + })(); + } } }, [user?.email]);