diff --git a/tools/walletextension/frontend/src/components/providers/wallet-provider.tsx b/tools/walletextension/frontend/src/components/providers/wallet-provider.tsx index 32d09cf29c..5b49b574ea 100644 --- a/tools/walletextension/frontend/src/components/providers/wallet-provider.tsx +++ b/tools/walletextension/frontend/src/components/providers/wallet-provider.tsx @@ -189,18 +189,14 @@ export const WalletConnectionProvider = ({ setProvider(providerInstance); initialize(providerInstance); - ethereum.on("accountsChanged", () => { - fetchUserAccounts(); - }); + ethereum.on("accountsChanged", fetchUserAccounts); } else { setLoading(false); } return () => { if (ethereum && ethereum.removeListener) { - ethereum.removeListener("accountsChanged", () => { - fetchUserAccounts(); - }); + ethereum.removeListener("accountsChanged", fetchUserAccounts); } }; }, []);