diff options
author | brunobar79 <brunobar79@gmail.com> | 2018-08-11 14:35:20 +0800 |
---|---|---|
committer | brunobar79 <brunobar79@gmail.com> | 2018-08-11 14:35:20 +0800 |
commit | 78a1cd3314455d6e4e08839a3eea3ec2868f4f59 (patch) | |
tree | 49c31a6b0d41de1d09120d683689b9445a5bceb6 /app/scripts/metamask-controller.js | |
parent | 5ef80495cfd47a8f5e4caf4b16842155420de62e (diff) | |
download | tangerine-wallet-browser-78a1cd3314455d6e4e08839a3eea3ec2868f4f59.tar tangerine-wallet-browser-78a1cd3314455d6e4e08839a3eea3ec2868f4f59.tar.gz tangerine-wallet-browser-78a1cd3314455d6e4e08839a3eea3ec2868f4f59.tar.bz2 tangerine-wallet-browser-78a1cd3314455d6e4e08839a3eea3ec2868f4f59.tar.lz tangerine-wallet-browser-78a1cd3314455d6e4e08839a3eea3ec2868f4f59.tar.xz tangerine-wallet-browser-78a1cd3314455d6e4e08839a3eea3ec2868f4f59.tar.zst tangerine-wallet-browser-78a1cd3314455d6e4e08839a3eea3ec2868f4f59.zip |
iframe communication working
Diffstat (limited to 'app/scripts/metamask-controller.js')
-rw-r--r-- | app/scripts/metamask-controller.js | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/app/scripts/metamask-controller.js b/app/scripts/metamask-controller.js index 593b722ff..58bab9789 100644 --- a/app/scripts/metamask-controller.js +++ b/app/scripts/metamask-controller.js @@ -546,12 +546,11 @@ module.exports = class MetamaskController extends EventEmitter { keyringName = TrezorKeyring.type break case 'ledger': - keyringName = TrezorKeyring.type + keyringName = LedgerKeyring.type break default: throw new Error('MetamaskController:connectHardware - Unknown device') } - let keyring = await this.keyringController.getKeyringsByType(keyringName)[0] if (!keyring) { keyring = await this.keyringController.addNewKeyring(keyringName) @@ -568,10 +567,8 @@ module.exports = class MetamaskController extends EventEmitter { */ async connectHardware (deviceName, page) { - const oldAccounts = await this.keyringController.getAccounts() const keyring = await this.getKeyringForDevice(deviceName) let accounts = [] - switch (page) { case -1: accounts = await keyring.getPreviousPage() @@ -585,6 +582,7 @@ module.exports = class MetamaskController extends EventEmitter { // Merge with existing accounts // and make sure addresses are not repeated + const oldAccounts = await this.keyringController.getAccounts() const accountsToTrack = [...new Set(oldAccounts.concat(accounts.map(a => a.address.toLowerCase())))] this.accountTracker.syncWithAddresses(accountsToTrack) return accounts |