diff --git a/src/utils/connection.js b/src/utils/connection.js index d336033..9b2223e 100644 --- a/src/utils/connection.js +++ b/src/utils/connection.js @@ -41,9 +41,22 @@ export function ConnectionProvider({ children }) { useEffect(() => { const id = connection.onSlotChange(() => null); - return () => clearInterval(id); + return () => connection.removeSlotChangeListener(id); }, [connection]); + useEffect(() => { + const id = sendConnection.onAccountChange( + new Account().publicKey, + () => {}, + ); + return () => sendConnection.removeAccountChangeListener(id); + }, [sendConnection]); + + useEffect(() => { + const id = sendConnection.onSlotChange(() => null); + return () => sendConnection.removeSlotChangeListener(id); + }, [sendConnection]); + return (