File tree Expand file tree Collapse file tree 1 file changed +4
-0
lines changed
Expand file tree Collapse file tree 1 file changed +4
-0
lines changed Original file line number Diff line number Diff line change 11import { SUPPORTED_CHAINS } from '@/config' ;
2+ import { useQueryClient } from '@tanstack/react-query' ;
23import { useEffect } from 'react' ;
34import { useAccount } from 'wagmi' ;
45import useUserStore from '@/stores/useUser.store' ;
@@ -12,6 +13,7 @@ export function useSyncAccountWithUserStore() {
1213 setChainId,
1314 setSubgraphUrl,
1415 } = useUserStore ( ) ;
16+ const queryClient = useQueryClient ( ) ;
1517
1618 useEffect ( ( ) => {
1719 // Update userStore
@@ -22,6 +24,7 @@ export function useSyncAccountWithUserStore() {
2224 const currentChain = SUPPORTED_CHAINS . find ( ( c ) => c . id === chain ?. id ) ;
2325 if ( currentChain ) {
2426 setSubgraphUrl ( currentChain ?. subgraphUrl ) ;
27+ queryClient . invalidateQueries ( { queryKey : [ ] } ) ;
2528 }
2629 } , [
2730 connector ,
@@ -34,5 +37,6 @@ export function useSyncAccountWithUserStore() {
3437 setAddress ,
3538 setChainId ,
3639 setSubgraphUrl ,
40+ queryClient ,
3741 ] ) ;
3842}
You can’t perform that action at this time.
0 commit comments