1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-11-29 23:58:06 +01:00

stop polling when switching networks

This commit is contained in:
frankiebee 2017-05-24 11:52:18 -04:00
parent e8288ad4bf
commit db982cf795
2 changed files with 6 additions and 1 deletions

View File

@ -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) => {

View File

@ -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: () => {},
}