mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-23 09:52:26 +01:00
Merge pull request #3760 from MetaMask/i3439-ResetCacheOnAccountReset
Fix bug where resetAccount does not clear network cache
This commit is contained in:
commit
f7a2dc984e
@ -2,6 +2,8 @@
|
||||
|
||||
## Current Master
|
||||
|
||||
- Fix bug where the "Reset account" feature would not clear the network cache.
|
||||
|
||||
## 4.4.0 Mon Mar 26 2018
|
||||
|
||||
- Internationalization: Taiwanese, Thai, Slovenian
|
||||
|
@ -367,7 +367,7 @@ module.exports = class MetamaskController extends EventEmitter {
|
||||
placeSeedWords: this.placeSeedWords.bind(this),
|
||||
verifySeedPhrase: nodeify(this.verifySeedPhrase, this),
|
||||
clearSeedWordCache: this.clearSeedWordCache.bind(this),
|
||||
resetAccount: this.resetAccount.bind(this),
|
||||
resetAccount: nodeify(this.resetAccount, this),
|
||||
importAccountWithStrategy: this.importAccountWithStrategy.bind(this),
|
||||
|
||||
// vault management
|
||||
@ -585,10 +585,15 @@ module.exports = class MetamaskController extends EventEmitter {
|
||||
/**
|
||||
* ?
|
||||
*/
|
||||
resetAccount (cb) {
|
||||
async resetAccount (cb) {
|
||||
const selectedAddress = this.preferencesController.getSelectedAddress()
|
||||
this.txController.wipeTransactions(selectedAddress)
|
||||
cb(null, selectedAddress)
|
||||
|
||||
const networkController = this.networkController
|
||||
const oldType = networkController.getProviderConfig().type
|
||||
await networkController.setProviderType(oldType, true)
|
||||
|
||||
return selectedAddress
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user