Skip to content

Commit

Permalink
Remove __networkChanged__ event listener
Browse files Browse the repository at this point in the history
I just noticed that __networkChanged__ is deprecated so I removed it.
  • Loading branch information
byterose authored Jul 26, 2021
1 parent d185a4e commit e7a8449
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/web3-store.js
Original file line number Diff line number Diff line change
Expand Up @@ -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(() => ({
Expand Down

0 comments on commit e7a8449

Please sign in to comment.