From b212e84d5389937ce2b8f9515eda8996bf61689f Mon Sep 17 00:00:00 2001 From: Nishad Date: Sat, 5 Sep 2020 07:53:18 +0800 Subject: [PATCH] Maintain websocket activity on sendConnection --- src/utils/connection.js | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) 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 (