1
0
mirror of https://github.com/trezor/trezor-wallet synced 2024-11-27 10:48:22 +00:00
This commit is contained in:
Vladimir Volek 2019-02-06 19:34:09 +01:00
commit 7432a9e37a
2 changed files with 3 additions and 3 deletions

View File

@ -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) => {

View File

@ -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<TrezorDevice>, transport: Transport) => {
if (isWebUSB(transport)) return false; // always enabled if webusb