forked from github/plane
Changed the crips-wrapper to only use crisp when env is set (#4139)
This commit is contained in:
parent
7bec244a67
commit
2ea6d70fac
@ -21,16 +21,18 @@ const CrispWrapper: FC<ICrispWrapper> = (props) => {
|
|||||||
if (typeof window && user?.email) {
|
if (typeof window && user?.email) {
|
||||||
window.$crisp = [];
|
window.$crisp = [];
|
||||||
window.CRISP_WEBSITE_ID = process.env.NEXT_PUBLIC_CRISP_ID;
|
window.CRISP_WEBSITE_ID = process.env.NEXT_PUBLIC_CRISP_ID;
|
||||||
(function () {
|
if (window.CRISP_WEBSITE_ID != null) {
|
||||||
const d = document;
|
(function () {
|
||||||
const s = d.createElement("script");
|
const d = document;
|
||||||
s.src = "https://client.crisp.chat/l.js";
|
const s = d.createElement("script");
|
||||||
s.async = true;
|
s.src = "https://client.crisp.chat/l.js";
|
||||||
d.getElementsByTagName("head")[0].appendChild(s);
|
s.async = true;
|
||||||
window.$crisp.push(["set", "user:email", [user.email]]);
|
d.getElementsByTagName("head")[0].appendChild(s);
|
||||||
window.$crisp.push(["do", "chat:hide"]);
|
window.$crisp.push(["set", "user:email", [user.email]]);
|
||||||
window.$crisp.push(["do", "chat:close"]);
|
window.$crisp.push(["do", "chat:hide"]);
|
||||||
})();
|
window.$crisp.push(["do", "chat:close"]);
|
||||||
|
})();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}, [user?.email]);
|
}, [user?.email]);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user