Skip to content

Commit

Permalink
[DDW-197] Improve device - wallet connection check on app start
Browse files Browse the repository at this point in the history
  • Loading branch information
Tomislav Horaček committed Oct 26, 2020
1 parent 1567f36 commit 8337676
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions source/renderer/app/stores/HardwareWalletsStore.js
Expand Up @@ -156,9 +156,15 @@ export default class HardwareWalletsStore extends Store {
};

getAvailableDevices = async () => {
await this.hardwareWalletsLocalDataRequest.execute();
await this.hardwareWalletDevicesRequest.execute();
console.debug('>>> SETUP:: getAvailableDevices ', {
hardwareWalletsConnectionData: this.hardwareWalletsConnectionData,
hardwareWalletDevices: this.hardwareWalletDevices,
})
// Set all logical HW into disconnected state
map(this.hardwareWalletsConnectionData, async (connectedWallet) => {
console.debug('>> connectedWallet: ', connectedWallet);
console.debug('>> SET connectedWallet to disconnected state: ', connectedWallet);
await this._setHardwareWalletLocalData({
walletId: connectedWallet.id,
data: {
Expand All @@ -168,10 +174,11 @@ export default class HardwareWalletsStore extends Store {
})

// Initiate Device Check for each stored device
map(this.hardwareWalletDevices, async dev => {
map(this.hardwareWalletDevices, async device => {
console.debug('>> Check Device: ', device);
await getHardwareWalletTransportChannel.request({
devicePath: dev.path,
isTrezor: true,
devicePath: device.path,
isTrezor: device.deviceType === DeviceTypes.TREZOR,
});
})

Expand Down

0 comments on commit 8337676

Please sign in to comment.