diff options
author | Dan Finlay <dan@danfinlay.com> | 2016-12-20 08:29:44 +0800 |
---|---|---|
committer | Dan Finlay <dan@danfinlay.com> | 2016-12-20 11:32:59 +0800 |
commit | 20d2204ce6a9e8dcd3269c588b2f4ce6ff93408b (patch) | |
tree | 5de7a5baa25e0e41708ccf366bfa7db486ee0d17 /app/scripts/lib | |
parent | 7b9749e30c4f8228fe62c1ad81515117cf7504bc (diff) | |
download | tangerine-wallet-browser-20d2204ce6a9e8dcd3269c588b2f4ce6ff93408b.tar tangerine-wallet-browser-20d2204ce6a9e8dcd3269c588b2f4ce6ff93408b.tar.gz tangerine-wallet-browser-20d2204ce6a9e8dcd3269c588b2f4ce6ff93408b.tar.bz2 tangerine-wallet-browser-20d2204ce6a9e8dcd3269c588b2f4ce6ff93408b.tar.lz tangerine-wallet-browser-20d2204ce6a9e8dcd3269c588b2f4ce6ff93408b.tar.xz tangerine-wallet-browser-20d2204ce6a9e8dcd3269c588b2f4ce6ff93408b.tar.zst tangerine-wallet-browser-20d2204ce6a9e8dcd3269c588b2f4ce6ff93408b.zip |
Made changes according to feedback.
Diffstat (limited to 'app/scripts/lib')
-rw-r--r-- | app/scripts/lib/config-manager.js | 3 | ||||
-rw-r--r-- | app/scripts/lib/idStore-migrator.js | 18 |
2 files changed, 10 insertions, 11 deletions
diff --git a/app/scripts/lib/config-manager.js b/app/scripts/lib/config-manager.js index efc0b4628..d36ccf0db 100644 --- a/app/scripts/lib/config-manager.js +++ b/app/scripts/lib/config-manager.js @@ -441,6 +441,5 @@ ConfigManager.prototype.setLostAccounts = function (lostAccounts) { ConfigManager.prototype.getLostAccounts = function () { var data = this.getData() - return ('lostAccounts' in data) && data.lostAccounts || [] + return data.lostAccounts || [] } - diff --git a/app/scripts/lib/idStore-migrator.js b/app/scripts/lib/idStore-migrator.js index 14bd0d8b8..2e9418376 100644 --- a/app/scripts/lib/idStore-migrator.js +++ b/app/scripts/lib/idStore-migrator.js @@ -2,6 +2,7 @@ const IdentityStore = require('./idStore') const HdKeyring = require('../keyrings/hd') const sigUtil = require('./sig-util') const normalize = sigUtil.normalize +const denodeify = require('denodeify') module.exports = class IdentityStoreMigrator { @@ -25,14 +26,13 @@ module.exports = class IdentityStoreMigrator { return Promise.resolve(null) } - return new Promise((resolve, reject) => { - this.idStore.submitPassword(password, (err) => { - if (err) return reject(err) - const serialized = this.serializeVault() - this.checkForErrors(serialized) - .then(resolve) - .catch(reject) - }) + const idStore = this.idStore + const submitPassword = denodeify(idStore.submitPassword.bind(idStore)) + + return submitPassword(password) + .then(() => { + const serialized = this.serializeVault() + return this.checkForLostAccounts(serialized) }) } @@ -46,7 +46,7 @@ module.exports = class IdentityStoreMigrator { } } - checkForErrors (serialized) { + checkForLostAccounts (serialized) { const hd = new HdKeyring() return hd.deserialize(serialized.data) .then((hexAccounts) => { |