From d3cc0dc0635b929136415fe2538ca042cbe95f39 Mon Sep 17 00:00:00 2001 From: staszekscp Date: Thu, 29 Feb 2024 12:55:32 +0100 Subject: [PATCH] update getEnvironment for HybridApp --- src/libs/Environment/getEnvironment/index.native.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/libs/Environment/getEnvironment/index.native.ts b/src/libs/Environment/getEnvironment/index.native.ts index 6d298c3fdae9..5dac0ad1d73e 100644 --- a/src/libs/Environment/getEnvironment/index.native.ts +++ b/src/libs/Environment/getEnvironment/index.native.ts @@ -1,3 +1,4 @@ +import {NativeModules} from 'react-native'; import Config from 'react-native-config'; import betaChecker from '@libs/Environment/betaChecker'; import CONST from '@src/CONST'; @@ -28,6 +29,12 @@ function getEnvironment(): Promise { return; } + // If we don't use Development, and we're in the HybridApp, we should use Production + if (NativeModules.HybridAppModule) { + environment = CONST.ENVIRONMENT.PRODUCTION; + return; + } + // If we haven't set the environment yet and we aren't on dev/adhoc, check to see if this is a beta build betaChecker.isBetaBuild().then((isBeta) => { environment = isBeta ? CONST.ENVIRONMENT.STAGING : CONST.ENVIRONMENT.PRODUCTION;