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' ;
2
1
import { Navigate , Outlet } from 'react-router-dom' ;
3
2
4
3
import { RouterPath } from '../../path' ;
@@ -11,18 +10,9 @@ type Props = {
11
10
} ;
12
11
13
12
const ProtectedRoute = ( { requiresAuth, sinittoOnly, guardOnly } : Props ) => {
14
- const [ isAuthLoading , setIsAuthLoading ] = useState ( true ) ;
15
13
const accessToken = authStorage . accessToken . get ( ) ;
16
14
const isSinitto = authStorage . isSinitto . get ( ) === 'true' ;
17
15
18
- useEffect ( ( ) => {
19
- setIsAuthLoading ( false ) ;
20
- } , [ accessToken , isSinitto ] ) ;
21
-
22
- if ( isAuthLoading ) {
23
- return < > </ > ;
24
- }
25
-
26
16
if ( requiresAuth && ! accessToken ) {
27
17
return < Navigate to = { RouterPath . ROOT } /> ;
28
18
}
Original file line number Diff line number Diff line change @@ -17,6 +17,8 @@ export const OnboardPage = () => {
17
17
setPage ( swiper . activeIndex ) ;
18
18
} ;
19
19
20
+ if ( window . location . pathname !== '/' ) return null ;
21
+
20
22
return (
21
23
< MainPageLayout page = { page } >
22
24
< Wrapper >
You can’t perform that action at this time.
0 commit comments