Hotfix/change domain
This commit is contained in:
parent
dce9380811
commit
d70b5d4283
@ -1,12 +1,10 @@
|
|||||||
import {
|
import {
|
||||||
useCallback,
|
|
||||||
useEffect,
|
|
||||||
useLayoutEffect,
|
|
||||||
useMemo,
|
|
||||||
useRef,
|
|
||||||
// useMemo,
|
|
||||||
// useRef,
|
|
||||||
useState,
|
useState,
|
||||||
|
useEffect,
|
||||||
|
useRef,
|
||||||
|
useCallback,
|
||||||
|
useMemo,
|
||||||
|
useLayoutEffect
|
||||||
} from "react";
|
} from "react";
|
||||||
import {
|
import {
|
||||||
Routes,
|
Routes,
|
||||||
@ -155,6 +153,7 @@ import CompatibilityV4Routes from "@/routerComponents/Compatibility/v4";
|
|||||||
import { useUnleashClient } from "@unleash/proxy-client-react";
|
import { useUnleashClient } from "@unleash/proxy-client-react";
|
||||||
import { useSession } from "@/hooks/session/useSession";
|
import { useSession } from "@/hooks/session/useSession";
|
||||||
import { getSourceByPathname } from "@/utils/source.utils";
|
import { getSourceByPathname } from "@/utils/source.utils";
|
||||||
|
import { navigateToAuth } from "@/utils/auth-navigation";
|
||||||
|
|
||||||
import "../palmistry/palmistry-container/palmistry-container.css"
|
import "../palmistry/palmistry-container/palmistry-container.css"
|
||||||
import ProfileRoutes from "@/routerComponents/Profile";
|
import ProfileRoutes from "@/routerComponents/Profile";
|
||||||
@ -1102,7 +1101,7 @@ function Layout(): JSX.Element {
|
|||||||
/>
|
/>
|
||||||
) : null}
|
) : null}
|
||||||
{isRouteFullDataModal && (
|
{isRouteFullDataModal && (
|
||||||
<Modal open={isShowFullDataModal} isCloseButtonVisible={false} onClose={() => { }}>
|
<Modal open={isShowFullDataModal} isCloseButtonVisible={false} onClose={() => setIsShowFullDataModal(false)}>
|
||||||
<FullDataModal onClose={onCloseFullDataModal} />
|
<FullDataModal onClose={onCloseFullDataModal} />
|
||||||
</Modal>
|
</Modal>
|
||||||
)}
|
)}
|
||||||
@ -1323,7 +1322,30 @@ function SkipStep(): JSX.Element {
|
|||||||
|
|
||||||
function MainPage(): JSX.Element {
|
function MainPage(): JSX.Element {
|
||||||
const status = useSelector(selectors.selectStatus);
|
const status = useSelector(selectors.selectStatus);
|
||||||
return <Navigate to={getRouteBy(status)} replace={true} />;
|
const route = getRouteBy(status);
|
||||||
|
const [shouldRedirect, setShouldRedirect] = useState(false);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
// Check if we're navigating to auth and on witlab.app domain
|
||||||
|
if (route === routes.client.auth()) {
|
||||||
|
const isWitlabDomain = window.location.hostname === 'witlab.app' ||
|
||||||
|
window.location.hostname.endsWith('.witlab.app');
|
||||||
|
|
||||||
|
// If we're on witlab.app domain, use server-side navigation
|
||||||
|
if (isWitlabDomain) {
|
||||||
|
navigateToAuth();
|
||||||
|
setShouldRedirect(true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}, [route]);
|
||||||
|
|
||||||
|
// If we're redirecting via server-side navigation, return empty fragment
|
||||||
|
if (shouldRedirect) {
|
||||||
|
return <></>;
|
||||||
|
}
|
||||||
|
|
||||||
|
// For all other cases, use client-side navigation
|
||||||
|
return <Navigate to={route} replace={true} />;
|
||||||
}
|
}
|
||||||
|
|
||||||
export default App;
|
export default App;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user