Skip to content

Commit

Permalink
feat: add export of network switch listen
Browse files Browse the repository at this point in the history
  • Loading branch information
simodrws committed Aug 29, 2023
1 parent ecec5c8 commit 650bab4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
1 change: 1 addition & 0 deletions src/refactor/wallet-client/network/index.ts
@@ -1 +1,2 @@
export * from './use-network';
export * from './use-network-switch-listen';
4 changes: 1 addition & 3 deletions src/refactor/wallet-client/network/use-network.ts
Expand Up @@ -47,13 +47,11 @@ export const useNetwork = () => {
if (!chainId) return;
setSwitchingToChain(chainId);
switchNetworkWagmi?.(chainId);
if (switchNetworkWagmi) stopSwitching();
} catch (error: unknown) {
if (switchNetworkWagmi) stopSwitching();
throw error as Error;
}
},
[switchNetworkWagmi, stopSwitching]
[switchNetworkWagmi]
);

const switchNetworkByName = useCallback(
Expand Down

0 comments on commit 650bab4

Please sign in to comment.