From: Chris Duncan Date: Fri, 8 Aug 2025 19:44:32 +0000 (-0700) Subject: Prioritize USB for Ledger for now. X-Git-Tag: v0.10.5~43^2~2 X-Git-Url: https://git.codecow.com/?a=commitdiff_plain;h=43496cca38f72d9d60420af6b71bc4fe6ea60304;p=libnemo.git Prioritize USB for Ledger for now. --- diff --git a/src/lib/ledger.ts b/src/lib/ledger.ts index f524c70..b7044a3 100644 --- a/src/lib/ledger.ts +++ b/src/lib/ledger.ts @@ -34,18 +34,18 @@ export class Ledger extends Wallet { /** * Check which transport protocols are supported by the browser and return the - * transport type according to the following priorities: Bluetooth, USB, HID. + * transport type according to the following priorities: USB, Bluetooth, HID. */ static get isUnsupported (): boolean { console.log('Checking browser Ledger support...') - if (typeof globalThis.navigator?.bluetooth?.getDevices === 'function') { - this.DynamicTransport = TransportBLE - return false - } if (typeof globalThis.navigator?.usb?.getDevices === 'function') { this.DynamicTransport = TransportUSB return false } + if (typeof globalThis.navigator?.bluetooth?.getDevices === 'function') { + this.DynamicTransport = TransportBLE + return false + } if (typeof globalThis.navigator?.hid?.getDevices === 'function') { this.DynamicTransport = TransportHID return false @@ -80,6 +80,7 @@ export class Ledger extends Wallet { } #accounts: AccountList + #safe: undefined #status: DeviceStatus = 'DISCONNECTED' get status (): DeviceStatus { return this.#status } @@ -90,6 +91,7 @@ export class Ledger extends Wallet { Ledger.#isInternal = false super('Ledger') this.#accounts = new AccountList() + this.#safe = undefined } /** diff --git a/src/lib/wallet.ts b/src/lib/wallet.ts index 840e9be..354fdc4 100644 --- a/src/lib/wallet.ts +++ b/src/lib/wallet.ts @@ -206,7 +206,7 @@ export class Wallet { Wallet.#isInternal = false this.#accounts = new AccountList() this.#id = id ?? crypto.randomUUID() - this.#safe = new WorkerQueue(type === 'Ledger' ? '' : SafeWorker) + this.#safe = new WorkerQueue(SafeWorker) this.#type = type }