From 185396ff08786dc108cabb57d47925032a9e2d74 Mon Sep 17 00:00:00 2001 From: Dan Finlay Date: Wed, 2 Nov 2016 16:35:46 -0700 Subject: Fix dual vault creation bug --- app/scripts/keyring-controller.js | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) (limited to 'app/scripts/keyring-controller.js') diff --git a/app/scripts/keyring-controller.js b/app/scripts/keyring-controller.js index f0fb0ad65..3b59c7890 100644 --- a/app/scripts/keyring-controller.js +++ b/app/scripts/keyring-controller.js @@ -131,12 +131,10 @@ module.exports = class KeyringController extends EventEmitter { const keyring = this.restoreKeyring(accountLength, serialized) this.keyrings.push(keyring) this.configManager.setSelectedAccount(keyring.getAccounts()[0]) - return this.persistAllKeyrings().then(() => { - return key - }) - } else { - return Promise.resolve(key) } + return this.persistAllKeyrings().then(() => { + return key + }) }) } @@ -147,12 +145,7 @@ module.exports = class KeyringController extends EventEmitter { return this.migrateAndGetKey(password) .then((key) => { - return new Promise((res, rej) => { - this.createFirstKeyTree(password, (err, state) => { - if (err) return rej(err) - res(configManager.getVault()) - }) - }) + cb(null, configManager.getVault()) }) .then((encryptedString) => { const serialized = this.keyrings[0].serialize() -- cgit v1.2.3