Skip to content

Commit

Permalink
Handle error code 21781 (#167)
Browse files Browse the repository at this point in the history
Co-authored-by: Filip Lelek <[email protected]>
  • Loading branch information
Filip-L and filip-neti authored Dec 11, 2024
1 parent e78e5d1 commit d3f85a3
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/lib/wallet/LedgerWallet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,9 @@ export class LedgerWallet extends BaseWallet {
const version = await this.ledgerApp.getVersion()

if (
version.return_code === 65535 &&
version.error_message.includes('LockedDeviceError') === true
(version.return_code === 65535 &&
version.error_message.includes('LockedDeviceError') === true) ||
version.return_code === 21781
) {
throw new Error('Ledger locked. Please, unlock it.')
}
Expand All @@ -83,7 +84,6 @@ export class LedgerWallet extends BaseWallet {
'Filecoin application is not open in Ledger. Please, open it.',
)
}

if (version.test_mode === true)
throw new Error('Filecoin app in test mode.')

Expand Down

0 comments on commit d3f85a3

Please sign in to comment.