diff options
author | Dan Finlay <dan@danfinlay.com> | 2016-11-03 07:18:47 +0800 |
---|---|---|
committer | Dan Finlay <dan@danfinlay.com> | 2016-11-03 07:18:47 +0800 |
commit | ed1917d71a464c5cf12d3dc283fcc30976134db8 (patch) | |
tree | 9e74282da5aa012ccffd31b0bee8d2e249003d7f | |
parent | 4cf1b606e46fa735263b5e1fade5910b572335e3 (diff) | |
download | tangerine-wallet-browser-ed1917d71a464c5cf12d3dc283fcc30976134db8.tar tangerine-wallet-browser-ed1917d71a464c5cf12d3dc283fcc30976134db8.tar.gz tangerine-wallet-browser-ed1917d71a464c5cf12d3dc283fcc30976134db8.tar.bz2 tangerine-wallet-browser-ed1917d71a464c5cf12d3dc283fcc30976134db8.tar.lz tangerine-wallet-browser-ed1917d71a464c5cf12d3dc283fcc30976134db8.tar.xz tangerine-wallet-browser-ed1917d71a464c5cf12d3dc283fcc30976134db8.tar.zst tangerine-wallet-browser-ed1917d71a464c5cf12d3dc283fcc30976134db8.zip |
Fix initial vault creation
-rw-r--r-- | app/scripts/keyring-controller.js | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/app/scripts/keyring-controller.js b/app/scripts/keyring-controller.js index 1b9739b9c..f0fb0ad65 100644 --- a/app/scripts/keyring-controller.js +++ b/app/scripts/keyring-controller.js @@ -122,6 +122,7 @@ module.exports = class KeyringController extends EventEmitter { return this.loadKey(password) .then((derivedKey) => { key = derivedKey + this.key = key return this.idStoreMigrator.oldSeedForPassword(password) }) .then((serialized) => { @@ -144,10 +145,13 @@ module.exports = class KeyringController extends EventEmitter { const salt = this.encryptor.generateSalt() configManager.setSalt(salt) - return new Promise((res, rej) => { - this.createFirstKeyTree(password, (err, state) => { - if (err) return rej(err) - res(configManager.getVault()) + return this.migrateAndGetKey(password) + .then((key) => { + return new Promise((res, rej) => { + this.createFirstKeyTree(password, (err, state) => { + if (err) return rej(err) + res(configManager.getVault()) + }) }) }) .then((encryptedString) => { |