Skip to content

Commit

Permalink
fix: reverted the changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Nuzhy-Deriv committed Nov 22, 2024
1 parent 2cbef94 commit 1a38399
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 26 deletions.
17 changes: 4 additions & 13 deletions public/scripts/freshchat.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,7 @@ class FreshChat {
}

static async initialize(options) {
try {
return new FreshChat(options);
} catch (error) {
console.warn("Error initializing FreshChat:", error);
}
return new FreshChat(options);
}

init = async () => {
Expand Down Expand Up @@ -48,14 +44,9 @@ class FreshChat {

script.onload = function () {
if (jwt) {
const checkWidget = setInterval(() => {
if (window.fcWidget?.user) {
window.fcWidget.user?.setProperties({
cf_user_jwt: jwt,
});
clearInterval(checkWidget);
}
}, 500);
window.fcWidget?.user?.setProperties({
cf_user_jwt: jwt,
});
}
};
};
Expand Down
17 changes: 4 additions & 13 deletions public/scripts/freshchat/freshchat-1.0.1.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,7 @@ class FreshChat {
}

static async initialize(options) {
try {
return new FreshChat(options);
} catch (error) {
console.warn("Error initializing FreshChat:", error);
}
return new FreshChat(options);
}

init = async () => {
Expand Down Expand Up @@ -89,14 +85,9 @@ class FreshChat {

script.onload = function () {
if (jwt) {
const checkWidget = setInterval(() => {
if (window.fcWidget?.user) {
window.fcWidget.user?.setProperties({
cf_user_jwt: jwt,
});
clearInterval(checkWidget);
}
}, 500);
window.fcWidget?.user?.setProperties({
cf_user_jwt: jwt,
});
}
};
};
Expand Down

0 comments on commit 1a38399

Please sign in to comment.