File tree Expand file tree Collapse file tree 2 files changed +14
-23
lines changed Expand file tree Collapse file tree 2 files changed +14
-23
lines changed Original file line number Diff line number Diff line change @@ -16,13 +16,27 @@ import LoginModal from './components/LoginModal';
1616import LocationModal from './components/LocationModal' ;
1717import TargetPriceModal from './components/TargetPriceModal' ;
1818import Main from './components/Main' ;
19+ import { useRecoilValue } from 'recoil' ;
20+ import GlobalState from './GlobalState' ;
21+ import { useEffect } from 'react' ;
22+ import { useNavigate } from 'react-router' ;
1923
2024export interface TodoItem1 {
2125 name : string ;
2226 id : string ;
2327}
2428
2529function App ( ) {
30+ const globalJwtTokenState = useRecoilValue ( GlobalState . jwtTokenState ) ;
31+ const globalUserUuidState = useRecoilValue ( GlobalState . userUuidState ) ;
32+ const navigate = useNavigate ( ) ;
33+
34+ useEffect ( ( ) => {
35+ if ( ( ! globalJwtTokenState || ! globalUserUuidState || globalJwtTokenState . length < 10 || globalUserUuidState . length < 10 ) ) {
36+ navigate ( '/' ) ;
37+ }
38+ } ) ;
39+
2640 return (
2741 < div className = "App" >
2842 < Header />
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments