From cb0af67f743d242afa3bdb518847f77d3c2cc260 Mon Sep 17 00:00:00 2001 From: kumavis Date: Wed, 22 Aug 2018 11:23:54 -0700 Subject: [PATCH] metamask controller - force account tracker to update balances on network change --- app/scripts/metamask-controller.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/scripts/metamask-controller.js b/app/scripts/metamask-controller.js index 29838ad2d..1e2df6368 100644 --- a/app/scripts/metamask-controller.js +++ b/app/scripts/metamask-controller.js @@ -127,6 +127,10 @@ module.exports = class MetamaskController extends EventEmitter { provider: this.provider, blockTracker: this.blockTracker, }) + // ensure accountTracker updates balances after network change + this.networkController.on('networkDidChange', () => { + this.accountTracker._updateAccounts() + }) // key mgmt const additionalKeyrings = [TrezorKeyring, LedgerBridgeKeyring]