Persist keyrings from migration to storage.

feature/default_network_editable
Kevin Serrano 8 years ago
parent bef023fb4a
commit cd2442e3e7
No known key found for this signature in database
GPG Key ID: 7CC862A58D2889B4
  1. 2
      app/scripts/keyring-controller.js

@ -117,7 +117,6 @@ module.exports = class KeyringController extends EventEmitter {
migrateAndGetKey (password) { migrateAndGetKey (password) {
let key let key
const shouldMigrate = !!this.configManager.getWallet() && !this.configManager.getVault() const shouldMigrate = !!this.configManager.getWallet() && !this.configManager.getVault()
return this.loadKey(password) return this.loadKey(password)
.then((derivedKey) => { .then((derivedKey) => {
key = derivedKey key = derivedKey
@ -128,6 +127,7 @@ module.exports = class KeyringController extends EventEmitter {
if (serialized && shouldMigrate) { if (serialized && shouldMigrate) {
const keyring = this.restoreKeyring(serialized) const keyring = this.restoreKeyring(serialized)
this.keyrings.push(keyring) this.keyrings.push(keyring)
this.persistAllKeyrings()
this.configManager.setSelectedAccount(keyring.getAccounts()[0]) this.configManager.setSelectedAccount(keyring.getAccounts()[0])
} }
return key return key

Loading…
Cancel
Save