diff --git a/src/state/application/updater.ts b/src/state/application/updater.ts index e85046be7d..d1023a38db 100644 --- a/src/state/application/updater.ts +++ b/src/state/application/updater.ts @@ -9,13 +9,12 @@ import { updateBlockNumber, updateChainId } from './actions' function useQueryCacheInvalidator() { const dispatch = useAppDispatch() - + // subscribe to `chainId` changes in the redux store rather than Web3 // this will ensure that when `invalidateTags` is called, the latest // `chainId` is available in redux to build the subgraph url const chainId = useAppSelector((state) => state.application.chainId) - useEffect(() => { dispatch(api.util.invalidateTags([CHAIN_TAG])) }, [chainId, dispatch])