Thanks to visit codestin.com
Credit goes to github.com

Skip to content
This repository was archived by the owner on May 20, 2025. It is now read-only.

Revert "khalid/add deriv.be domain" #2517

Merged
1 commit merged into from
Jan 17, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion gatsby-browser.js
Original file line number Diff line number Diff line change
Expand Up @@ -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%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',
'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',
),
)
}
Expand Down
16 changes: 4 additions & 12 deletions src/common/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,27 +2,19 @@ const isBrowser = () => typeof window !== 'undefined'

const deriv_com_url = 'deriv.com'
const deriv_me_url = 'deriv.me'
const deriv_be_url = 'deriv.be'

export const deriv_com_app_id = 16929
export const deriv_me_app_id = 1411
export const deriv_be_app_id = 30767
const deriv_com_app_id = 16929
const deriv_me_app_id = 1411

const supported_domains = [deriv_com_url, deriv_me_url, deriv_be_url]
const supported_domains = [deriv_com_url, deriv_me_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 = getDomainAppID()
export const deriv_app_id = domain_url === deriv_com_url ? deriv_com_app_id : deriv_me_app_id
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`
Expand Down
15 changes: 3 additions & 12 deletions src/common/websocket/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,26 +7,17 @@
*
*/
import { isBrowser } from '../utility'
import {
default_server_url,
deriv_com_app_id,
deriv_me_app_id,
deriv_be_app_id,
} from '../constants'
import { default_server_url } from '../constants'

export const domain_config = {
production: [
{
hostname: 'deriv.com',
app_id: deriv_com_app_id,
app_id: 11780,
},
{
hostname: 'deriv.me',
app_id: deriv_me_app_id,
},
{
hostname: 'deriv.be',
app_id: deriv_be_app_id,
app_id: 1411,
},
],
staging: {
Expand Down