diff options
author | Frankie <frankie.diamond@gmail.com> | 2017-01-25 04:28:05 +0800 |
---|---|---|
committer | Frankie <frankie.diamond@gmail.com> | 2017-01-25 04:28:05 +0800 |
commit | 48ffea0142bf68a49f30887b3509786d7e751895 (patch) | |
tree | 48eaa3ecf81cbdbf14c78316b43b3f9f29a5741c /app/scripts/keyring-controller.js | |
parent | 8642ced310890c7a3202a2826a2c74fad1fefca3 (diff) | |
download | tangerine-wallet-browser-48ffea0142bf68a49f30887b3509786d7e751895.tar tangerine-wallet-browser-48ffea0142bf68a49f30887b3509786d7e751895.tar.gz tangerine-wallet-browser-48ffea0142bf68a49f30887b3509786d7e751895.tar.bz2 tangerine-wallet-browser-48ffea0142bf68a49f30887b3509786d7e751895.tar.lz tangerine-wallet-browser-48ffea0142bf68a49f30887b3509786d7e751895.tar.xz tangerine-wallet-browser-48ffea0142bf68a49f30887b3509786d7e751895.tar.zst tangerine-wallet-browser-48ffea0142bf68a49f30887b3509786d7e751895.zip |
Move the assumption of their only being one hd keyring when requesting seed words to metamaskController
Diffstat (limited to 'app/scripts/keyring-controller.js')
-rw-r--r-- | app/scripts/keyring-controller.js | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/app/scripts/keyring-controller.js b/app/scripts/keyring-controller.js index 95f0a1d63..7a46c7737 100644 --- a/app/scripts/keyring-controller.js +++ b/app/scripts/keyring-controller.js @@ -171,11 +171,8 @@ module.exports = class KeyringController extends EventEmitter { // // Used when creating a first vault, to allow confirmation. // Also used when revealing the seed words in the confirmation view. - placeSeedWords () { - const hdKeyrings = this.keyrings.filter((keyring) => keyring.type === 'HD Key Tree') - const firstKeyring = hdKeyrings[0] - if (!firstKeyring) throw new Error('KeyringController - No HD Key Tree found') - return firstKeyring.serialize() + placeSeedWords (selectedKeyring) { + return selectedKeyring.serialize() .then((serialized) => { const seedWords = serialized.mnemonic this.configManager.setSeedWords(seedWords) @@ -436,7 +433,7 @@ module.exports = class KeyringController extends EventEmitter { this.emit('newAccount', hexAccount) return this.setupAccounts(accounts) }).then(() => { - return this.placeSeedWords() + return this.placeSeedWords(this.getKeyringsByType('HD Key Tree')[0]) }) .then(this.persistAllKeyrings.bind(this)) } |