Skip to content

Commit

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

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

Expand All @@ -80,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 2539b2e

Please sign in to comment.