@@ -47,10 +47,6 @@ export function App({bodyshop, checkUserSession, currentUser, online, setOnline}
|
|||||||
const [listenersAdded, setListenersAdded] = useState(false)
|
const [listenersAdded, setListenersAdded] = useState(false)
|
||||||
const {t} = useTranslation();
|
const {t} = useTranslation();
|
||||||
|
|
||||||
// Handle The Beta Switch.
|
|
||||||
useEffect(() => {
|
|
||||||
handleBeta();
|
|
||||||
}, [])
|
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (!navigator.onLine) {
|
if (!navigator.onLine) {
|
||||||
@@ -58,6 +54,8 @@ export function App({bodyshop, checkUserSession, currentUser, online, setOnline}
|
|||||||
}
|
}
|
||||||
|
|
||||||
checkUserSession();
|
checkUserSession();
|
||||||
|
|
||||||
|
handleBeta();
|
||||||
}, [checkUserSession, setOnline]);
|
}, [checkUserSession, setOnline]);
|
||||||
|
|
||||||
//const b = Grid.useBreakpoint();
|
//const b = Grid.useBreakpoint();
|
||||||
|
|||||||
@@ -24,14 +24,14 @@ export const handleBeta = () => {
|
|||||||
|
|
||||||
// Beta is enabled, but the current host name does start with beta.
|
// Beta is enabled, but the current host name does start with beta.
|
||||||
if (isBeta && !currentHostName.startsWith('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.reload();
|
window.location.replace(href);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Beta is not enabled, but the current host name does start with beta.
|
// Beta is not enabled, but the current host name does start with beta.
|
||||||
else if (!isBeta && currentHostName.startsWith('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.reload();
|
window.location.replace(href);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
export default handleBeta;
|
export default handleBeta;
|
||||||
|
|||||||
Reference in New Issue
Block a user