Skip to content

Commit

Permalink
Handle error code 21781
Browse files Browse the repository at this point in the history
  • Loading branch information
filip-neti committed Dec 11, 2024
1 parent e78e5d1 commit 9713375
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions src/lib/wallet/LedgerWallet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,7 @@ export class LedgerWallet extends BaseWallet {
this.ledgerApp = new FilecoinApp(transport)
const version = await this.ledgerApp.getVersion()

if (
version.return_code === 65535 &&
version.error_message.includes('LockedDeviceError') === true
) {
if (version.return_code === 65535 || version.return_code === 21781) {
throw new Error('Ledger locked. Please, unlock it.')
}

Expand Down

0 comments on commit 9713375

Please sign in to comment.