diff --git a/src/components/Header.vue b/src/components/Header.vue index 9f0cb5c..583e28d 100644 --- a/src/components/Header.vue +++ b/src/components/Header.vue @@ -197,7 +197,8 @@ export default { // destroyed() {}, methods: { testForCountryPage() { - this.hideNavigation = /^[a-zA-Z]{2}.casper.network/.test(window.location.hostname); + const { hostname } = window.location; + this.hideNavigation = /^[a-zA-Z]{2}.casper.network/.test(hostname) || /^[a-zA-Z]{2}.staging.casper.network/.test(hostname); }, goHome() { if (this.hideNavigation) { diff --git a/src/router/index.js b/src/router/index.js index 7b6fc56..ea6f1d3 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -86,11 +86,16 @@ export function getRouter() { let isCountryLP = false; let countryCode = null; - const hostname = window.location.hostname; + const { hostname } = window.location; - if (/^[a-zA-Z]{2}.casper.network/.test(hostname)) { + const prodDomainTest = /^[a-zA-Z]{2}.casper.network/.test(hostname); + const stagingDomainTest = /^[a-zA-Z]{2}.staging.casper.network/.test(hostname); + if (prodDomainTest || stagingDomainTest) { isCountryLP = true; countryCode = hostname.replace('.casper.network', ''); + if (countryCode.includes('.')) { + countryCode = hostname.replace('.staging.casper.network', ''); + } ignoreLanguage = true; language = 'en-us'; }