mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-23 09:52:26 +01:00
Refresh computed balances controller when restoring vault
This commit is contained in:
parent
ea79eca8eb
commit
9cc1e8a6d8
@ -25,6 +25,10 @@ class ComputedbalancesController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
forgetAllBalances () {
|
||||||
|
this.balances = {}
|
||||||
|
}
|
||||||
|
|
||||||
_initBalanceUpdating () {
|
_initBalanceUpdating () {
|
||||||
const store = this.accountTracker.store.getState()
|
const store = this.accountTracker.store.getState()
|
||||||
this.addAnyAccountsFromStore(store)
|
this.addAnyAccountsFromStore(store)
|
||||||
|
@ -473,7 +473,7 @@ module.exports = class MetamaskController extends EventEmitter {
|
|||||||
}
|
}
|
||||||
|
|
||||||
forgetOldAccounts () {
|
forgetOldAccounts () {
|
||||||
const { accountTracker } = this
|
const { accountTracker, balancesController } = this
|
||||||
let oldAccounts = []
|
let oldAccounts = []
|
||||||
try {
|
try {
|
||||||
oldAccounts = Object.keys(accountTracker.store.getState().accounts)
|
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)
|
log.warn('Could not load old accounts to forget', e)
|
||||||
}
|
}
|
||||||
oldAccounts.forEach(addr => accountTracker.removeAccount(addr))
|
oldAccounts.forEach(addr => accountTracker.removeAccount(addr))
|
||||||
|
balancesController.forgetAllBalances()
|
||||||
}
|
}
|
||||||
|
|
||||||
selectFirstIdentity (vault) {
|
selectFirstIdentity (vault) {
|
||||||
|
Loading…
Reference in New Issue
Block a user