fix: Return if window.$chatwoot is already defined (#3847)

This commit is contained in:
Pranav Raj S
2022-01-25 16:39:19 -08:00
committed by GitHub
parent 8cff690640
commit 23965fbaa3

View File

@@ -27,6 +27,10 @@ export const hasUserKeys = user =>
REQUIRED_USER_KEYS.reduce((acc, key) => acc || !!user[key], false);
const runSDK = ({ baseUrl, websiteToken }) => {
if (window.$chatwoot) {
return;
}
const chatwootSettings = window.chatwootSettings || {};
window.$chatwoot = {
baseUrl,