From 6fec7395807debc30ac84c24b4b0ecc82afbf96e Mon Sep 17 00:00:00 2001 From: lubej <9722540+lubej@users.noreply.github.com> Date: Thu, 11 Jan 2024 14:41:46 +0100 Subject: [PATCH] Fix Brave browser off event listeners --- src/providers/Web3Provider.tsx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/providers/Web3Provider.tsx b/src/providers/Web3Provider.tsx index 2ccd2cd..23596eb 100644 --- a/src/providers/Web3Provider.tsx +++ b/src/providers/Web3Provider.tsx @@ -96,10 +96,10 @@ export const Web3ContextProvider: FC = ({ children }) => { } const _removeEventListeners = (ethProvider = window.ethereum!) => { - ethProvider.off('accountsChanged', _accountsChanged) - ethProvider.off('chainChanged', _chainChanged) - ethProvider.off('connect', _connect) - ethProvider.off('disconnect', _disconnect) + ethProvider.off?.('accountsChanged', _accountsChanged) + ethProvider.off?.('chainChanged', _chainChanged) + ethProvider.off?.('connect', _connect) + ethProvider.off?.('disconnect', _disconnect) } const _init = async (account: string) => {