Skip to content
This repository has been archived by the owner on Nov 6, 2020. It is now read-only.

Commit

Permalink
Fix detecting hardware wallets. (#6509)
Browse files Browse the repository at this point in the history
  • Loading branch information
tomusdrw authored and arkpar committed Sep 15, 2017
1 parent 3e60b22 commit b24bb10
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions js/src/mobx/hardwareStore.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ export default class HardwareStore {
this._api = api;
this._ledger = Ledger.create(api);
this._pollId = null;
this.hwAccounts = {};
this.ledgerAccounts = {};

this._pollScan();
this._subscribeParity();
Expand Down Expand Up @@ -101,7 +103,8 @@ export default class HardwareStore {
info.address = address;
info.via = 'parity';
});
this.setWallets(hwInfo);
this.hwAccounts = hwInfo;
this.updateWallets();
return hwInfo;
},
onError
Expand All @@ -117,13 +120,18 @@ export default class HardwareStore {
// not intended as a network call, i.e. hw wallet is with the user)
return this.scanLedger()
.then((ledgerAccounts) => {
this.ledgerAccounts = ledgerAccounts;
transaction(() => {
this.setWallets(Object.assign({}, ledgerAccounts));
this.updateWallets();
this.setScanning(false);
});
});
}

updateWallets () {
this.setWallets(Object.assign({}, this.hwAccounts, this.ledgerAccounts));
}

createAccountInfo (entry, original = {}) {
const { address, manufacturer, name } = entry;

Expand Down

0 comments on commit b24bb10

Please sign in to comment.