diff options
Got bad account detection working and added to state
Diffstat (limited to 'app/scripts/keyring-controller.js')
-rw-r--r-- | app/scripts/keyring-controller.js | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/app/scripts/keyring-controller.js b/app/scripts/keyring-controller.js index d0ce16cbb..6a087c918 100644 --- a/app/scripts/keyring-controller.js +++ b/app/scripts/keyring-controller.js @@ -623,16 +623,17 @@ module.exports = class KeyringController extends EventEmitter { // may be completed without interruption. migrateOldVaultIfAny (password) { const shouldMigrate = !!this.configManager.getWallet() && !this.configManager.getVault() + if (!shouldMigrate) { + return Promise.resolve() + } + return this.idStoreMigrator.migratedVaultForPassword(password) .then((result) => { - console.log('migrator called back with') - console.dir(result) - const { serialized, lostAccounts } = result - console.dir({ serialized, lostAccounts }) - this.configManager.setLostAccounts(lostAccounts) this.password = password - if (serialized && shouldMigrate) { + if (result && shouldMigrate) { + const { serialized, lostAccounts } = result + this.configManager.setLostAccounts(lostAccounts) return this.restoreKeyring(serialized) .then(keyring => keyring.getAccounts()) .then((accounts) => { |