From: Chris Duncan Date: Wed, 10 Sep 2025 22:22:02 +0000 (-0700) Subject: Prioritize HID over USB. X-Git-Tag: v0.10.5~14^2~30 X-Git-Url: https://git.codecow.com/?a=commitdiff_plain;h=e52f5be496eb36ce40a45555ba4928fae9b764dd;p=libnemo.git Prioritize HID over USB. Current Ledger firmware is having issues communicating over WebUSB. WebHID is a different tech stack, and Ledger recommends using it first and foremost, so reorder priority of transports. --- diff --git a/src/lib/wallet/ledger.ts b/src/lib/wallet/ledger.ts index 9b64960..af7b93f 100644 --- a/src/lib/wallet/ledger.ts +++ b/src/lib/wallet/ledger.ts @@ -54,7 +54,7 @@ export class Ledger { 0x9000: 'OK' }) - static DynamicTransport: typeof TransportBLE | typeof TransportUSB | typeof TransportHID + static DynamicTransport: typeof TransportHID | typeof TransportBLE | typeof TransportUSB static UsbVendorId = ledgerUSBVendorId static SYMBOL: Symbol = Symbol('Ledger') @@ -64,16 +64,16 @@ export class Ledger { */ static get isUnsupported (): boolean { console.log('Checking browser Ledger support...') - if (typeof globalThis.navigator?.usb?.getDevices === 'function') { - this.DynamicTransport = TransportUSB + if (typeof globalThis.navigator?.hid?.getDevices === 'function') { + this.DynamicTransport = TransportHID return false } if (typeof globalThis.navigator?.bluetooth?.getDevices === 'function') { this.DynamicTransport = TransportBLE return false } - if (typeof globalThis.navigator?.hid?.getDevices === 'function') { - this.DynamicTransport = TransportHID + if (typeof globalThis.navigator?.usb?.getDevices === 'function') { + this.DynamicTransport = TransportUSB return false } return true