Skip to content

Commit

Permalink
fix(wallet): prevent Trezor device from returning busyness errors
Browse files Browse the repository at this point in the history
The hardware wallet connect UX is causing Trezor device to throw an
error indicating that the device is busy processing the previous
request. Avoid this situation by using the connect screen exclusively
for Ledger.
  • Loading branch information
onyb committed Nov 16, 2021
1 parent f9e71b5 commit c41510c
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -170,9 +170,9 @@ handler.on(PanelActions.approveHardwareTransaction.getType(), async (store: Stor
}

const apiProxy = getWalletPanelApiProxy()
await navigateToConnectHardwareWallet(store)

if (hardwareAccount.hardware.vendor === LEDGER_HARDWARE_VENDOR) {
await navigateToConnectHardwareWallet(store)
const { success, error, deviceError } = await signLedgerTransaction(apiProxy, hardwareAccount.hardware.path, txInfo)
if (!success) {
if (deviceError) {
Expand All @@ -192,6 +192,7 @@ handler.on(PanelActions.approveHardwareTransaction.getType(), async (store: Stor
refreshTransactionHistory(txInfo.fromAddress)
}
} else if (hardwareAccount.hardware.vendor === TREZOR_HARDWARE_VENDOR) {
apiProxy.panelHandler.setCloseOnDeactivate(false)
const { success, error } = await signTrezorTransaction(apiProxy, hardwareAccount.hardware.path, txInfo)
if (!success) {
console.log(error)
Expand All @@ -200,7 +201,7 @@ handler.on(PanelActions.approveHardwareTransaction.getType(), async (store: Stor
refreshTransactionHistory(txInfo.fromAddress)
}

await store.dispatch(PanelActions.navigateToMain())
apiProxy.panelHandler.setCloseOnDeactivate(true)
}
})

Expand Down

0 comments on commit c41510c

Please sign in to comment.