diff options
author | Kevin Serrano <kevgagser@gmail.com> | 2016-11-19 07:58:49 +0800 |
---|---|---|
committer | Kevin Serrano <kevgagser@gmail.com> | 2016-11-19 07:58:49 +0800 |
commit | bc6312e9e3d3a48b886f53279f13f176c71e4019 (patch) | |
tree | 5eb47355bacc1362bac4e9a2e6a802181d083838 | |
parent | c695d54b01bf4766f20e3f9e00e980df3408e29d (diff) | |
download | tangerine-wallet-browser-bc6312e9e3d3a48b886f53279f13f176c71e4019.tar tangerine-wallet-browser-bc6312e9e3d3a48b886f53279f13f176c71e4019.tar.gz tangerine-wallet-browser-bc6312e9e3d3a48b886f53279f13f176c71e4019.tar.bz2 tangerine-wallet-browser-bc6312e9e3d3a48b886f53279f13f176c71e4019.tar.lz tangerine-wallet-browser-bc6312e9e3d3a48b886f53279f13f176c71e4019.tar.xz tangerine-wallet-browser-bc6312e9e3d3a48b886f53279f13f176c71e4019.tar.zst tangerine-wallet-browser-bc6312e9e3d3a48b886f53279f13f176c71e4019.zip |
Promisify persistence of keyrings before returning key
Change single letter variables (shame)
-rw-r--r-- | app/scripts/keyring-controller.js | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/app/scripts/keyring-controller.js b/app/scripts/keyring-controller.js index 9046108c0..cf761c88c 100644 --- a/app/scripts/keyring-controller.js +++ b/app/scripts/keyring-controller.js @@ -127,8 +127,9 @@ module.exports = class KeyringController extends EventEmitter { if (serialized && shouldMigrate) { const keyring = this.restoreKeyring(serialized) this.keyrings.push(keyring) - this.persistAllKeyrings() this.configManager.setSelectedAccount(keyring.getAccounts()[0]) + return this.persistAllKeyrings() + .then(() => { return key }) } return key }) @@ -274,13 +275,12 @@ module.exports = class KeyringController extends EventEmitter { } persistAllKeyrings () { - const serialized = this.keyrings.map((k) => { + const serialized = this.keyrings.map((keyring) => { return { - type: k.type, - data: k.serialize(), + type: keyring.type, + data: keyring.serialize(), } }) - return this.encryptor.encryptWithKey(this.key, serialized) .then((encryptedString) => { this.configManager.setVault(encryptedString) |