From e255f0a664c2974046ae81ff2d1aef5053e0af0e Mon Sep 17 00:00:00 2001 From: Dave Richer Date: Thu, 18 Jan 2024 16:50:30 -0500 Subject: [PATCH] - update handleBeta Signed-off-by: Dave Richer --- client/src/App/App.jsx | 6 +++--- client/src/utils/betaHandler.js | 6 ++++-- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/client/src/App/App.jsx b/client/src/App/App.jsx index f1ead3cb8..d858ce36a 100644 --- a/client/src/App/App.jsx +++ b/client/src/App/App.jsx @@ -54,9 +54,7 @@ export function App({bodyshop, checkUserSession, currentUser, online, setOnline} } checkUserSession(); - - handleBeta(); - }, [checkUserSession, setOnline]); + }, [checkUserSession, setOnline]); //const b = Grid.useBreakpoint(); // console.log("Breakpoints:", b); @@ -102,6 +100,8 @@ export function App({bodyshop, checkUserSession, currentUser, online, setOnline} return ; } + handleBeta(); + if (!online) return ( { // Beta is enabled, but the current host name does start with beta. if (isBeta && !currentHostName.startsWith('beta')) { - window.location.href = `${window.location.protocol}//beta.${currentHostName}${window.location.pathname}${window.location.search}${window.location.hash}`; + const href = `${window.location.protocol}//beta.${currentHostName}${window.location.pathname}${window.location.search}${window.location.hash}`; + window.location.replace(href); } // Beta is not enabled, but the current host name does start with beta. else if (!isBeta && currentHostName.startsWith('beta')) { - window.location.href = `${window.location.protocol}//${currentHostName.replace('beta.', '')}${window.location.pathname}${window.location.search}${window.location.hash}`; + const href = `${window.location.protocol}//${currentHostName.replace('beta.', '')}${window.location.pathname}${window.location.search}${window.location.hash}`; + window.location.replace(href); } } export default handleBeta; \ No newline at end of file