Skip to content

Commit

Permalink
Progress
Browse files Browse the repository at this point in the history
  • Loading branch information
ryangoree committed Feb 20, 2024
1 parent 465172b commit a063daf
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 0 additions & 2 deletions apps/council-ui/src/ui/council/hooks/useReadCouncil.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ export function useReadCouncil(): ReadCouncil {
throw new Error("Public client is not available");
}

console.log("Making new ReadCouncil");

return new ReadCouncil({
publicClient,
cache: sdkCache,
Expand Down
12 changes: 7 additions & 5 deletions apps/council-ui/src/ui/network/hooks/useSupportedChainId.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { useMemo } from "react";
import { SupportedChainId } from "src/config/council.config";
import { chains } from "src/lib/wagmi";
import { useChainId } from "wagmi";
Expand All @@ -8,9 +9,10 @@ const defaultChainId = chains[0].id as SupportedChainId;
export function useSupportedChainId(): SupportedChainId {
const chainId = useChainId() as SupportedChainId;

if (allChainIds.includes(chainId)) {
return chainId;
}

return defaultChainId;
return useMemo(() => {
if (allChainIds.includes(chainId)) {
return chainId;
}
return defaultChainId;
}, [chainId]);
}

0 comments on commit a063daf

Please sign in to comment.