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

[beta] Fix detecting hardware wallets #6509

Merged
merged 1 commit into from
Sep 15, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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