Maintain websocket activity on sendConnection
This commit is contained in:
parent
841fbf3702
commit
b212e84d53
|
@ -41,9 +41,22 @@ export function ConnectionProvider({ children }) {
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const id = connection.onSlotChange(() => null);
|
const id = connection.onSlotChange(() => null);
|
||||||
return () => clearInterval(id);
|
return () => connection.removeSlotChangeListener(id);
|
||||||
}, [connection]);
|
}, [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 (
|
return (
|
||||||
<ConnectionContext.Provider
|
<ConnectionContext.Provider
|
||||||
value={{ endpoint, setEndpoint, connection, sendConnection }}
|
value={{ endpoint, setEndpoint, connection, sendConnection }}
|
||||||
|
|
Loading…
Reference in New Issue