Skip to content

Commit

Permalink
fix: faucet
Browse files Browse the repository at this point in the history
  • Loading branch information
songwongtp committed May 25, 2023
1 parent 257994b commit fc16281
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions src/lib/app-provider/hooks/useNetworkChange.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,15 @@ export const useNetworkChange = (
? getFirstQueryParam(router.query.network, DEFAULT_SUPPORTED_CHAIN_ID)
: router.asPath.split("/")[1];

// Redirect to default chain if the chain is not supported by the app
if (!SUPPORTED_CHAIN_IDS.includes(networkRoute))
networkRoute = DEFAULT_SUPPORTED_CHAIN_ID;
if (router.isReady || router.pathname === "/404") {
// Redirect to default chain if the chain is not supported by the app
if (!SUPPORTED_CHAIN_IDS.includes(networkRoute))
networkRoute = DEFAULT_SUPPORTED_CHAIN_ID;

if (networkRoute !== networkRef.current) {
networkRef.current = networkRoute;
handleOnChainIdChange(networkRoute);
if (networkRoute !== networkRef.current) {
networkRef.current = networkRoute;
handleOnChainIdChange(networkRoute);
}
}
}, [
handleOnChainIdChange,
Expand Down

0 comments on commit fc16281

Please sign in to comment.