mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-11-26 20:39:08 +01:00
stop polling when switching networks
This commit is contained in:
parent
e8288ad4bf
commit
db982cf795
@ -53,6 +53,7 @@ module.exports = class NetworkController extends EventEmitter {
|
||||
this.providerInit = newInit
|
||||
|
||||
this._provider.removeAllListeners()
|
||||
this._provider.stop()
|
||||
this.provider = MetaMaskProvider(newInit)
|
||||
// apply the listners created by other controllers
|
||||
Object.keys(this._providerListeners).forEach((key) => {
|
||||
|
@ -12,7 +12,11 @@ describe('# Network Controller', function () {
|
||||
},
|
||||
})
|
||||
// stub out provider
|
||||
networkController._provider = new EventEmitter()
|
||||
networkController._provider = new Proxy(new EventEmitter(), {
|
||||
get: (obj, name) => {
|
||||
return () => {}
|
||||
},
|
||||
})
|
||||
networkController.providerInit = {
|
||||
getAccounts: () => {},
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user