aboutsummaryrefslogtreecommitdiffstats
path: root/packages/website/ts/utils/utils.ts
diff options
context:
space:
mode:
authorFrancesco Agosti <francesco.agosti93@gmail.com>2018-05-16 07:35:05 +0800
committerGitHub <noreply@github.com>2018-05-16 07:35:05 +0800
commitcc486cb86d46cefbd31a43a87be3ee9b3fd461a6 (patch)
tree8d84b11bb5e427e1987386ca82a40aeda6fdbf0e /packages/website/ts/utils/utils.ts
parent7a45a579c072612b9c45da47db026635b721faec (diff)
parentdc58d539c2ec0561974323aced0841d17117927d (diff)
downloaddexon-sol-tools-cc486cb86d46cefbd31a43a87be3ee9b3fd461a6.tar
dexon-sol-tools-cc486cb86d46cefbd31a43a87be3ee9b3fd461a6.tar.gz
dexon-sol-tools-cc486cb86d46cefbd31a43a87be3ee9b3fd461a6.tar.bz2
dexon-sol-tools-cc486cb86d46cefbd31a43a87be3ee9b3fd461a6.tar.lz
dexon-sol-tools-cc486cb86d46cefbd31a43a87be3ee9b3fd461a6.tar.xz
dexon-sol-tools-cc486cb86d46cefbd31a43a87be3ee9b3fd461a6.tar.zst
dexon-sol-tools-cc486cb86d46cefbd31a43a87be3ee9b3fd461a6.zip
Merge pull request #593 from 0xProject/bug/website/fix-cirular-dependency
Fix circular dependency
Diffstat (limited to 'packages/website/ts/utils/utils.ts')
-rw-r--r--packages/website/ts/utils/utils.ts9
1 files changed, 6 insertions, 3 deletions
diff --git a/packages/website/ts/utils/utils.ts b/packages/website/ts/utils/utils.ts
index c3e261ddb..3c99bd2fe 100644
--- a/packages/website/ts/utils/utils.ts
+++ b/packages/website/ts/utils/utils.ts
@@ -24,6 +24,8 @@ import * as u2f from 'ts/vendor/u2f_api';
const LG_MIN_EM = 64;
const MD_MIN_EM = 52;
+const isDogfood = (): boolean => _.includes(window.location.href, configs.DOMAIN_DOGFOOD);
+
export const utils = {
assert(condition: boolean, message: string): void {
if (!condition) {
@@ -302,13 +304,14 @@ export const utils = {
}
return parsedProviderName;
},
+ getBackendBaseUrl(): string {
+ return isDogfood() ? configs.BACKEND_BASE_STAGING_URL : configs.BACKEND_BASE_PROD_URL;
+ },
isDevelopment(): boolean {
return configs.ENVIRONMENT === Environments.DEVELOPMENT;
},
isStaging(): boolean {
return _.includes(window.location.href, configs.DOMAIN_STAGING);
},
- isDogfood(): boolean {
- return _.includes(window.location.href, configs.DOMAIN_DOGFOOD);
- },
+ isDogfood,
};