From 6e7697d927a64f5d9e7ac1fd7f8aa2adaee7c331 Mon Sep 17 00:00:00 2001 From: muhammad-ahmed Date: Tue, 26 Nov 2024 16:17:39 +0800 Subject: [PATCH 1/2] ahmed/fix--prod-env-config-modification --- src/utils/constants.ts | 5 +++++ src/utils/index.ts | 10 +++++++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/src/utils/constants.ts b/src/utils/constants.ts index 7059e498d..590cd8135 100644 --- a/src/utils/constants.ts +++ b/src/utils/constants.ts @@ -2,6 +2,11 @@ export const PRODUCTION_APP_ID = '36544'; export const STAGING_APP_ID = '36545'; export const VERCEL_DEPLOYMENT_APP_ID = '35073'; export const LOCALHOST_APP_ID = '35074'; +export const PRODUCTION_ME_APP_ID = '61569' +export const PRODUCTION_BE_APP_ID = '61570' +export const STAGING_ME_APP_ID = '61571' +export const STAGING_BE_APP_ID = '61572' + export const DEFAULT_WS_SERVER = 'ws.derivws.com'; export const OAUTH_URL = 'oauth.deriv.com'; diff --git a/src/utils/index.ts b/src/utils/index.ts index aca66f03d..f42e566f7 100644 --- a/src/utils/index.ts +++ b/src/utils/index.ts @@ -8,6 +8,10 @@ import { VERCEL_DEPLOYMENT_APP_ID, OAUTH_URL, DEFAULT_WS_SERVER, + PRODUCTION_ME_APP_ID, + PRODUCTION_BE_APP_ID, + STAGING_ME_APP_ID, + STAGING_BE_APP_ID, } from './constants'; const CURRENCY_MAP = new Map([ @@ -86,8 +90,12 @@ export const getAppId = () => { if (isHost('staging-api.deriv.com')) return STAGING_APP_ID; if (isHost('deriv-api-docs.binary.sx')) return VERCEL_DEPLOYMENT_APP_ID; if (isHost('api.deriv.com')) return PRODUCTION_APP_ID; + if (isHost('api.deriv.me')) return PRODUCTION_ME_APP_ID; + if (isHost('api.deriv.be')) return PRODUCTION_BE_APP_ID; + if (isHost('staging-api.deriv.me')) return STAGING_ME_APP_ID; + if (isHost('staging-api.deriv.be')) return STAGING_BE_APP_ID; - return VERCEL_DEPLOYMENT_APP_ID; + return PRODUCTION_APP_ID; }; /** From 0128ea768212c86e16ecf1d51a698b3ec05ad5eb Mon Sep 17 00:00:00 2001 From: muhammad-ahmed Date: Tue, 26 Nov 2024 16:30:26 +0800 Subject: [PATCH 2/2] fix unit test --- src/utils/__tests__/utils.test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/utils/__tests__/utils.test.ts b/src/utils/__tests__/utils.test.ts index 48c857321..366f8e618 100644 --- a/src/utils/__tests__/utils.test.ts +++ b/src/utils/__tests__/utils.test.ts @@ -31,7 +31,7 @@ describe('Get App ID', () => { it('By default it should return vercel staging ap id if hostname is not listed', () => { window.location.hostname = 'asdfasdf'; const appId = getAppId(); - expect(appId).toBe('35073'); + expect(appId).toBe('36544'); }); it("Should return 35074 when it's called in localhost environment", () => { window.location.hostname = 'localhost';