diff options
author | Dan Finlay <dan@danfinlay.com> | 2017-10-19 05:22:04 +0800 |
---|---|---|
committer | Dan Finlay <dan@danfinlay.com> | 2017-10-19 05:22:04 +0800 |
commit | 9cc1e8a6d867b7f0663c55b017b471132f6a719e (patch) | |
tree | ad6997c313f964bd6b53e7b05e807615e2b40e89 | |
parent | ea79eca8eb19cf7ce375e03ad8cbde010299936c (diff) | |
download | tangerine-wallet-browser-9cc1e8a6d867b7f0663c55b017b471132f6a719e.tar tangerine-wallet-browser-9cc1e8a6d867b7f0663c55b017b471132f6a719e.tar.gz tangerine-wallet-browser-9cc1e8a6d867b7f0663c55b017b471132f6a719e.tar.bz2 tangerine-wallet-browser-9cc1e8a6d867b7f0663c55b017b471132f6a719e.tar.lz tangerine-wallet-browser-9cc1e8a6d867b7f0663c55b017b471132f6a719e.tar.xz tangerine-wallet-browser-9cc1e8a6d867b7f0663c55b017b471132f6a719e.tar.zst tangerine-wallet-browser-9cc1e8a6d867b7f0663c55b017b471132f6a719e.zip |
Refresh computed balances controller when restoring vault
-rw-r--r-- | app/scripts/controllers/computed-balances.js | 4 | ||||
-rw-r--r-- | app/scripts/metamask-controller.js | 3 |
2 files changed, 6 insertions, 1 deletions
diff --git a/app/scripts/controllers/computed-balances.js b/app/scripts/controllers/computed-balances.js index 2479e1b3a..3479eae2b 100644 --- a/app/scripts/controllers/computed-balances.js +++ b/app/scripts/controllers/computed-balances.js @@ -25,6 +25,10 @@ class ComputedbalancesController { } } + forgetAllBalances () { + this.balances = {} + } + _initBalanceUpdating () { const store = this.accountTracker.store.getState() this.addAnyAccountsFromStore(store) diff --git a/app/scripts/metamask-controller.js b/app/scripts/metamask-controller.js index b6a3749e4..b312106dd 100644 --- a/app/scripts/metamask-controller.js +++ b/app/scripts/metamask-controller.js @@ -473,7 +473,7 @@ module.exports = class MetamaskController extends EventEmitter { } forgetOldAccounts () { - const { accountTracker } = this + const { accountTracker, balancesController } = this let oldAccounts = [] try { oldAccounts = Object.keys(accountTracker.store.getState().accounts) @@ -481,6 +481,7 @@ module.exports = class MetamaskController extends EventEmitter { log.warn('Could not load old accounts to forget', e) } oldAccounts.forEach(addr => accountTracker.removeAccount(addr)) + balancesController.forgetAllBalances() } selectFirstIdentity (vault) { |