mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-05 19:26:38 +00:00
Merge pull request #2638 from scott-ray-wilson/fix-region-display
Fix: refine check of when to display region select
This commit is contained in:
@@ -78,10 +78,16 @@ export const RegionSelect = () => {
|
|||||||
router.push(`https://${value}.infisical.com/${router.pathname}`);
|
router.push(`https://${value}.infisical.com/${router.pathname}`);
|
||||||
};
|
};
|
||||||
|
|
||||||
const [subdomain, domain] = window.location.host.split(".");
|
const shouldDisplay =
|
||||||
|
window.location.origin.includes("https://app.infisical.com") ||
|
||||||
|
window.location.origin.includes("https://us.infisical.com") ||
|
||||||
|
window.location.origin.includes("https://eu.infisical.com") ||
|
||||||
|
window.location.origin.includes("http://localhost:8080");
|
||||||
|
|
||||||
// only display region select for cloud
|
// only display region select for cloud
|
||||||
if (!domain?.match(/infisical/)) return null;
|
if (!shouldDisplay) return null;
|
||||||
|
|
||||||
|
const [subdomain] = window.location.host.split(".");
|
||||||
|
|
||||||
// default to US if not eu
|
// default to US if not eu
|
||||||
const currentRegion = subdomain === Region.EU ? regions[1] : regions[0];
|
const currentRegion = subdomain === Region.EU ? regions[1] : regions[0];
|
||||||
|
|||||||
Reference in New Issue
Block a user