Skip to content

Commit

Permalink
fix: update appid, hostname
Browse files Browse the repository at this point in the history
  • Loading branch information
Nuzhy-Deriv committed Oct 21, 2024
1 parent 57b8855 commit c3567f4
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions public/scripts/freshchat-temp.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
class FreshChat {
tokenForWS = undefined;
hostname = localStorage.getItem("config.server_url");
appId = localStorage.getItem("config.app_id");

Expand All @@ -18,8 +17,8 @@ class FreshChat {
if (this.authToken) {
jwt = await this.fetchJWTToken({
token: this.authToken,
appId: this.appId,
server: this.hostname,
appId: this.appId || 1,
server: this.hostname || "green.derivws.com",
});
}

Expand Down Expand Up @@ -52,11 +51,7 @@ class FreshChat {
};
};

fetchJWTToken = async ({
token,
appId = 1,
server = "green.derivws.com",
}) => {
fetchJWTToken = async ({ token, appId, server }) => {
try {
const response = await fetch(
`https://${server}/websockets/service_token?app_id=${appId}&l=EN&brand=deriv`,
Expand Down

0 comments on commit c3567f4

Please sign in to comment.