aboutsummaryrefslogtreecommitdiffstats
path: root/app/scripts/keyring-controller.js
diff options
context:
space:
mode:
Diffstat (limited to 'app/scripts/keyring-controller.js')
-rw-r--r--app/scripts/keyring-controller.js7
1 files changed, 4 insertions, 3 deletions
diff --git a/app/scripts/keyring-controller.js b/app/scripts/keyring-controller.js
index 4fa2b4ee8..68cf62f7a 100644
--- a/app/scripts/keyring-controller.js
+++ b/app/scripts/keyring-controller.js
@@ -118,6 +118,7 @@ module.exports = class KeyringController extends EventEmitter {
return this.idStoreMigrator.migratedVaultForPassword(password)
.then((serialized) => {
if (serialized && shouldMigrate) {
+ this.password = password
const keyring = this.restoreKeyring(serialized)
this.keyrings.push(keyring)
this.configManager.setSelectedAccount(keyring.getAccounts()[0])
@@ -185,7 +186,6 @@ module.exports = class KeyringController extends EventEmitter {
cb(null, this.getState())
})
.catch((err) => {
- console.error(err)
cb(err)
})
}
@@ -274,8 +274,9 @@ module.exports = class KeyringController extends EventEmitter {
unlockKeyrings (password) {
const encryptedVault = this.configManager.getVault()
- return this.encryptor.decrypt(this.password, encryptedVault)
+ return this.encryptor.decrypt(password, encryptedVault)
.then((vault) => {
+ this.password = password
vault.forEach(this.restoreKeyring.bind(this))
return this.keyrings
})
@@ -557,7 +558,7 @@ module.exports = class KeyringController extends EventEmitter {
}
setLocked (cb) {
- this.key = null
+ this.password = null
this.keyrings = []
this.emit('update')
cb()