Maintain websocket activity on sendConnection
This commit is contained in:
parent
841fbf3702
commit
b212e84d53
|
@ -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 (
|
||||
<ConnectionContext.Provider
|
||||
value={{ endpoint, setEndpoint, connection, sendConnection }}
|
||||
|
|
Loading…
Reference in New Issue