Skip to content

Commit

Permalink
update getEnvironment for HybridApp
Browse files Browse the repository at this point in the history
  • Loading branch information
staszekscp committed Feb 29, 2024
1 parent 3389b90 commit d3cc0dc
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/libs/Environment/getEnvironment/index.native.ts
Original file line number Diff line number Diff line change
@@ -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';
Expand Down Expand Up @@ -28,6 +29,12 @@ function getEnvironment(): Promise<Environment> {
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;
Expand Down

0 comments on commit d3cc0dc

Please sign in to comment.