-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #13029 from Expensify/vit-experiementWithStagingNa…
…tive Enable native staging apps to use Staging API
- Loading branch information
Showing
4 changed files
with
37 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import CONFIG from '../../CONFIG'; | ||
|
||
/** | ||
* Helper method used to decide which API endpoint to call | ||
* | ||
* @param {Boolean} stagingServerToggleState | ||
* @returns {Boolean} | ||
*/ | ||
function shouldUseStagingServer(stagingServerToggleState) { | ||
return CONFIG.IS_IN_STAGING && stagingServerToggleState; | ||
} | ||
|
||
export default shouldUseStagingServer; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import * as Environment from '../Environment/Environment'; | ||
|
||
/** | ||
* Helper method used to decide which API endpoint to call in the Native apps. | ||
* We build the staging native apps with production env config so we cannot rely on those values, | ||
* hence we will decide solely on the value of the shouldUseStagingServer value (always false in production). | ||
* | ||
* @param {Boolean} stagingServerToggleState | ||
* @returns {Boolean} | ||
*/ | ||
export default function shouldUseStagingServer(stagingServerToggleState) { | ||
return !Environment.isDevelopment() && stagingServerToggleState; | ||
} |