diff --git a/gatsby-browser.js b/gatsby-browser.js index 4d102f42b83..e9f58993555 100644 --- a/gatsby-browser.js +++ b/gatsby-browser.js @@ -16,7 +16,7 @@ const is_browser = typeof window !== 'undefined' const checkDomain = () => { return eval( decodeURIComponent( - 'var%20curhost%20%3D%20window.location.hostname%3B%20var%20t8hvj%20%3D%20%2F%5Cb%28deriv%7Cbinary%7Cbinaryqa%5B0-9%5D%7B2%7D%29%5C.%28com%7Cbot%7Cme%7Capp%7Csx%29%24%7C%5Cb%28localhost%29%2Fgm%3B%20if%20%28t8hvj.test%28curhost%29%20%3D%3D%20false%29%7Balert%28%22Not%20our%20domain%22%29%7D', + 'var%20curhost%20%3D%20window.location.hostname%3B%20var%20t8hvj%20%3D%20%2F%5Cb%28deriv%7Cbinary%7Cbinaryqa%5B0-9%5D%7B2%7D%29%5C.%28com%7Cbot%7Cme%7Cbe%7Capp%7Csx%29%24%7C%5Cb%28localhost%29%2Fgm%3B%20if%20%28t8hvj.test%28curhost%29%20%3D%3D%20false%29%7Balert%28%22Not%20our%20domain%22%29%7D', ), ) } diff --git a/src/common/constants.js b/src/common/constants.js index a878dd3d623..66e565da96c 100644 --- a/src/common/constants.js +++ b/src/common/constants.js @@ -2,19 +2,27 @@ const isBrowser = () => typeof window !== 'undefined' const deriv_com_url = 'deriv.com' const deriv_me_url = 'deriv.me' +const deriv_be_url = 'deriv.be' -const deriv_com_app_id = 16929 -const deriv_me_app_id = 1411 +export const deriv_com_app_id = 16929 +export const deriv_me_app_id = 1411 +export const deriv_be_app_id = 30767 -const supported_domains = [deriv_com_url, deriv_me_url] +const supported_domains = [deriv_com_url, deriv_me_url, deriv_be_url] const domain_url = isBrowser() && supported_domains.includes(window.location.hostname) ? window.location.hostname : deriv_com_url +const getDomainAppID = () => { + if (domain_url === deriv_me_url) return deriv_me_app_id + else if (domain_url === deriv_be_url) return deriv_be_app_id + else return deriv_com_app_id +} + // URL export const domain_full_url = `https://${domain_url}` -export const deriv_app_id = domain_url === deriv_com_url ? deriv_com_app_id : deriv_me_app_id +export const deriv_app_id = getDomainAppID() export const deriv_app_url = `https://app.${domain_url}` export const deriv_api_url = `https://api.${domain_url}` export const deriv_bot_app_url = `${deriv_app_url}/bot` diff --git a/src/common/websocket/config.js b/src/common/websocket/config.js index b5432301d38..6fa3c2293db 100644 --- a/src/common/websocket/config.js +++ b/src/common/websocket/config.js @@ -7,17 +7,26 @@ * */ import { isBrowser } from '../utility' -import { default_server_url } from '../constants' +import { + default_server_url, + deriv_com_app_id, + deriv_me_app_id, + deriv_be_app_id, +} from '../constants' export const domain_config = { production: [ { hostname: 'deriv.com', - app_id: 11780, + app_id: deriv_com_app_id, }, { hostname: 'deriv.me', - app_id: 1411, + app_id: deriv_me_app_id, + }, + { + hostname: 'deriv.be', + app_id: deriv_be_app_id, }, ], staging: {