File tree Expand file tree Collapse file tree 2 files changed +2
-10
lines changed
app/routes/components/protected-route Expand file tree Collapse file tree 2 files changed +2
-10
lines changed Original file line number Diff line number Diff line change 1- import { useState , useEffect } from 'react' ;
21import { Navigate , Outlet } from 'react-router-dom' ;
32
43import { RouterPath } from '../../path' ;
@@ -11,18 +10,9 @@ type Props = {
1110} ;
1211
1312const ProtectedRoute = ( { requiresAuth, sinittoOnly, guardOnly } : Props ) => {
14- const [ isAuthLoading , setIsAuthLoading ] = useState ( true ) ;
1513 const accessToken = authStorage . accessToken . get ( ) ;
1614 const isSinitto = authStorage . isSinitto . get ( ) === 'true' ;
1715
18- useEffect ( ( ) => {
19- setIsAuthLoading ( false ) ;
20- } , [ accessToken , isSinitto ] ) ;
21-
22- if ( isAuthLoading ) {
23- return < > </ > ;
24- }
25-
2616 if ( requiresAuth && ! accessToken ) {
2717 return < Navigate to = { RouterPath . ROOT } /> ;
2818 }
Original file line number Diff line number Diff line change @@ -17,6 +17,8 @@ export const OnboardPage = () => {
1717 setPage ( swiper . activeIndex ) ;
1818 } ;
1919
20+ if ( window . location . pathname !== '/' ) return null ;
21+
2022 return (
2123 < MainPageLayout page = { page } >
2224 < Wrapper >
You can’t perform that action at this time.
0 commit comments