File tree Expand file tree Collapse file tree 1 file changed +3
-0
lines changed Expand file tree Collapse file tree 1 file changed +3
-0
lines changed Original file line number Diff line number Diff line change @@ -15,20 +15,23 @@ import {Button} from '@mui/material';
15
15
import { FormEvent } from 'react' ;
16
16
import { useSetRecoilState , useRecoilState } from "recoil" ;
17
17
import GlobalState from "../GlobalState" ;
18
+ import { useNavigate } from "react-router" ;
18
19
19
20
const Header = ( ) => {
20
21
const setLocationModalState = useSetRecoilState ( GlobalState . locationModalState ) ;
21
22
const setTargetPriceModalState = useSetRecoilState ( GlobalState . targetPriceModalState ) ;
22
23
const setJwtTokenState = useSetRecoilState ( GlobalState . jwtTokenState ) ;
23
24
const setGlobalLoginModal = useSetRecoilState ( GlobalState . loginModalState ) ;
24
25
const [ globalWebWorkerRefState , setGlobalWebWorkerRefState ] = useRecoilState ( GlobalState . webWorkerRefState ) ;
26
+ const navigate = useNavigate ( ) ;
25
27
26
28
const logout = ( event : FormEvent ) => {
27
29
console . log ( "Logout " , event ) ;
28
30
setJwtTokenState ( '' ) ;
29
31
globalWebWorkerRefState ?. postMessage ( { jwtToken : '' , newNotificationUrl : '' } ) ;
30
32
setGlobalWebWorkerRefState ( null ) ;
31
33
setGlobalLoginModal ( true ) ;
34
+ navigate ( '/' ) ;
32
35
}
33
36
const location = ( event : FormEvent ) => {
34
37
//console.log("Location ",event);
You can’t perform that action at this time.
0 commit comments