Skip to content

Commit

Permalink
Early exit if chainId is undefined, so that we don't stick bad keys i…
Browse files Browse the repository at this point in the history
…n local storage
  • Loading branch information
adamgall committed Mar 7, 2024
1 parent 3daa4d6 commit d3ded32
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/hooks/DAO/loaders/useFractalGuardContracts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,10 @@ export const useFractalGuardContracts = ({ loadOnMount = true }: { loadOnMount?:
}, [action, daoAddress, safe, fractalModules, loadFractalGuardContracts]);

useEffect(() => {
if (chainId === undefined) {
return;
}

if (daoAddress && chainId + daoAddress !== loadKey.current && loadOnMount && isModulesLoaded) {
loadKey.current = chainId + daoAddress;
setGuardContracts();
Expand Down

0 comments on commit d3ded32

Please sign in to comment.