diff --git a/src/utils/__tests__/device.test.js b/src/utils/__tests__/device.test.js index 78281035..aa38e5f3 100644 --- a/src/utils/__tests__/device.test.js +++ b/src/utils/__tests__/device.test.js @@ -40,9 +40,9 @@ describe('device utils', () => { it('isWebUSB', () => { const data = [ - { transport: { type: 'ParallelTransport', version: 'webusb' } }, + { transport: { type: 'webusb', version: '1.6.0' } }, { transport: { type: null, version: 'aaaaaa' } }, - { transport: { type: 'ParallelTransport', version: 'webusb' } }, + { transport: { type: 'webusb' } }, ]; data.forEach((item) => { diff --git a/src/utils/device.js b/src/utils/device.js index bd3b29aa..e0cada08 100644 --- a/src/utils/device.js +++ b/src/utils/device.js @@ -79,7 +79,7 @@ export const getStatusName = (deviceStatus: string): string => { } }; -export const isWebUSB = (transport: Transport) => !!((transport.type && transport.version.indexOf('webusb') >= 0)); +export const isWebUSB = (transport: Transport) => !!((transport.type && transport.type === 'webusb')); export const isDisabled = (selectedDevice: TrezorDevice, devices: Array, transport: Transport) => { if (isWebUSB(transport)) return false; // always enabled if webusb