diff options
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 |