Skip to content

Commit

Permalink
fix: do not reconnect on mount
Browse files Browse the repository at this point in the history
  • Loading branch information
chybisov committed Jun 7, 2024
1 parent 4bd50e9 commit 650b24f
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 3 deletions.
6 changes: 5 additions & 1 deletion packages/wallet-management/src/createDefaultWagmiConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,11 @@ export interface DefaultWagmiConfigResult {
* export const WalletProvider: FC<PropsWithChildren> = ({ children }) => {
* const { chains } = useAvailableChains();
* useSyncWagmiConfig(config, connectors, chains);
* return <WagmiProvider config={config}>{children}</WagmiProvider>;
* return (
* <WagmiProvider config={wagmi.config} reconnectOnMount={false}>
* {children}
* </WagmiProvider>
* );
* };
*/
export function createDefaultWagmiConfig(
Expand Down
6 changes: 5 additions & 1 deletion packages/widget-embedded/src/providers/WalletProvider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,9 @@ export const WalletProvider: FC<PropsWithChildren> = ({ children }) => {

useSyncWagmiConfig(config, connectors, chains);

return <WagmiProvider config={config}>{children}</WagmiProvider>;
return (
<WagmiProvider config={config} reconnectOnMount={false}>
{children}
</WagmiProvider>
);
};
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,9 @@ export const EVMBaseProvider: FC<PropsWithChildren> = ({ children }) => {

useSyncWagmiConfig(wagmi.config, wagmi.connectors, chains);

return <WagmiProvider config={wagmi.config}>{children}</WagmiProvider>;
return (
<WagmiProvider config={wagmi.config} reconnectOnMount={false}>
{children}
</WagmiProvider>
);
};

0 comments on commit 650b24f

Please sign in to comment.