From 3c89c782e3a0fb3fa3833bd20ca279f42968afc5 Mon Sep 17 00:00:00 2001 From: Vladimir Volek Date: Wed, 6 Feb 2019 18:52:12 +0100 Subject: [PATCH 1/3] Fixed webusb button --- src/utils/device.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 From 9616d53d694c38c643b46df25643c92ca2cbef9b Mon Sep 17 00:00:00 2001 From: Vladimir Volek Date: Wed, 6 Feb 2019 18:56:50 +0100 Subject: [PATCH 2/3] Fix eslint --- src/views/Wallet/components/LeftNavigation/index.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/views/Wallet/components/LeftNavigation/index.js b/src/views/Wallet/components/LeftNavigation/index.js index ac7a37ab..d440832c 100644 --- a/src/views/Wallet/components/LeftNavigation/index.js +++ b/src/views/Wallet/components/LeftNavigation/index.js @@ -257,7 +257,8 @@ class LeftNavigation extends React.PureComponent { color={colors.TEXT_SECONDARY} /> - ) : null + + ) : null } {this.props.devices.length > 1 && ( Date: Wed, 6 Feb 2019 19:24:29 +0100 Subject: [PATCH 3/3] Fix unit test --- src/utils/__tests__/device.test.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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) => {