From e7a8449706876787dcb79bacccd1d824dd397849 Mon Sep 17 00:00:00 2001 From: byterose <77129089+byterose@users.noreply.github.com> Date: Mon, 26 Jul 2021 16:49:10 +0200 Subject: [PATCH] Remove __networkChanged__ event listener I just noticed that __networkChanged__ is deprecated so I removed it. --- src/web3-store.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/web3-store.js b/src/web3-store.js index 6b71300..07123c0 100644 --- a/src/web3-store.js +++ b/src/web3-store.js @@ -49,13 +49,11 @@ export const createStore = () => { const accounts = /127/.test(provider) ? [] : await instance.eth.getAccounts() if (callback) { instance._provider.removeListener('accountsChanged', () => setProvider(provider, true)) - // instance._provider.removeListener('chainChanged', () => setProvider(provider, true)) - instance._provider.removeListener('networkChanged', () => setProvider(provider, true)) + instance._provider.removeListener('chainChanged', () => setProvider(provider, true)) } else { if (instance._provider && instance._provider.on) { instance._provider.on('accountsChanged', () => setProvider(provider, true)) - // instance._provider.on('chainChanged', () => setProvider(provider, true)) - instance._provider.on('networkChanged', () => setProvider(provider, true)) + instance._provider.on('chainChanged', () => setProvider(provider, true)) } } update(() => ({