diff options
author | brunobar79 <brunobar79@gmail.com> | 2018-07-17 13:17:18 +0800 |
---|---|---|
committer | brunobar79 <brunobar79@gmail.com> | 2018-07-17 13:17:18 +0800 |
commit | de4265c629f8e68d882c2ded0e20417327cf4d2f (patch) | |
tree | 0c2a9abc3a83fc103861d48c19f455118859ab49 /app | |
parent | e5512c306ded1d2a521a0ba0d2c3cdd5878e53bb (diff) | |
download | tangerine-wallet-browser-de4265c629f8e68d882c2ded0e20417327cf4d2f.tar tangerine-wallet-browser-de4265c629f8e68d882c2ded0e20417327cf4d2f.tar.gz tangerine-wallet-browser-de4265c629f8e68d882c2ded0e20417327cf4d2f.tar.bz2 tangerine-wallet-browser-de4265c629f8e68d882c2ded0e20417327cf4d2f.tar.lz tangerine-wallet-browser-de4265c629f8e68d882c2ded0e20417327cf4d2f.tar.xz tangerine-wallet-browser-de4265c629f8e68d882c2ded0e20417327cf4d2f.tar.zst tangerine-wallet-browser-de4265c629f8e68d882c2ded0e20417327cf4d2f.zip |
added more unit tests
Diffstat (limited to 'app')
-rw-r--r-- | app/scripts/metamask-controller.js | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/app/scripts/metamask-controller.js b/app/scripts/metamask-controller.js index 2f114e9f0..7d3f4c2a8 100644 --- a/app/scripts/metamask-controller.js +++ b/app/scripts/metamask-controller.js @@ -628,17 +628,16 @@ module.exports = class MetamaskController extends EventEmitter { const oldAccounts = await keyringController.getAccounts() const keyState = await keyringController.addNewAccount(keyring) const newAccounts = await keyringController.getAccounts() - // Assuming the trezor account is the last one - const trezorAccount = newAccounts[newAccounts.length - 1] this.preferencesController.setAddresses(newAccounts) + console.log('new vs old', newAccounts, oldAccounts) newAccounts.forEach(address => { if (!oldAccounts.includes(address)) { + console.log('new address found', address) + this.preferencesController.setAccountLabel(address, `TREZOR #${parseInt(index, 10) + 1}`) this.preferencesController.setSelectedAddress(address) } }) - this.preferencesController.setAccountLabel(trezorAccount, `TREZOR #${parseInt(index, 10) + 1}`) - this.preferencesController.setSelectedAddress(trezorAccount) const { identities } = this.preferencesController.store.getState() return { ...keyState, identities } } |