aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--app/scripts/controllers/computed-balances.js4
-rw-r--r--app/scripts/metamask-controller.js3
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) {