diff --git a/src/lib/wallet/LedgerWallet.ts b/src/lib/wallet/LedgerWallet.ts index 4c73519..1d4efe3 100644 --- a/src/lib/wallet/LedgerWallet.ts +++ b/src/lib/wallet/LedgerWallet.ts @@ -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.') } @@ -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.')