File tree Expand file tree Collapse file tree 2 files changed +3
-18
lines changed
Expand file tree Collapse file tree 2 files changed +3
-18
lines changed Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ import { Firewall } from './pages/Firewall';
1313import { useQueryClient } from '@tanstack/react-query' ;
1414import NFProxy from './pages/NFProxy' ;
1515import ServiceDetailsNFProxy from './pages/NFProxy/ServiceDetails' ;
16- import { useAuth } from './js/store' ;
16+ import { useAuthStore } from './js/store' ;
1717
1818function App ( ) {
1919
@@ -23,7 +23,7 @@ function App() {
2323 const [ error , setError ] = useState < string | null > ( )
2424 const [ loadinBtn , setLoadingBtn ] = useState ( false ) ;
2525 const queryClient = useQueryClient ( )
26- const { isAuthenticated , access_token } = useAuth ( )
26+ const { access_token } = useAuthStore ( )
2727
2828 useEffect ( ( ) => {
2929 socketio . auth = { token : access_token || "" }
@@ -43,7 +43,7 @@ function App() {
4343 socketio . off ( "connect_error" )
4444 socketio . disconnect ( )
4545 }
46- } , [ isAuthenticated ] )
46+ } , [ access_token ] )
4747
4848 const getStatus = ( ) => {
4949 getstatus ( ) . then ( res => {
Original file line number Diff line number Diff line change @@ -42,21 +42,6 @@ export const useAuthStore = create<AuthState>()(
4242 )
4343) ;
4444
45- // Hook personalizzati per un uso più facile nei componenti
46- export const useAuth = ( ) => {
47- const { access_token, setAccessToken, clearAccessToken, getAccessToken } = useAuthStore ( ) ;
48-
49- const isAuthenticated = ! ! access_token ;
50-
51- return {
52- access_token,
53- isAuthenticated,
54- setAccessToken,
55- clearAccessToken,
56- getAccessToken,
57- } ;
58- } ;
59-
6045interface SessionState {
6146 home_section : string | null ;
6247 setHomeSection : ( section : string | null ) => void ;
You can’t perform that action at this time.
0 commit comments