mirror of
https://github.com/trezor/trezor-wallet
synced 2024-11-27 10:48:22 +00:00
merge
This commit is contained in:
commit
7432a9e37a
@ -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) => {
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user