1
0
mirror of https://github.com/trezor/trezor-wallet synced 2024-12-25 16:38:08 +00:00

disable device menu when there's only 1 device and it's unacquired

This commit is contained in:
Szymon Lesisz 2018-05-16 16:08:30 +02:00
parent 0329801f94
commit a62559909d

View File

@ -50,10 +50,13 @@ export const DeviceSelect = (props: Props) => {
const deviceCount = devices.length;
const webusb: boolean = (transport && transport.version.indexOf('webusb') >= 0) ? true : false;
const disabled: boolean = (devices.length < 1 && !webusb);
const disabled: boolean = (devices.length < 1 && !webusb) || (devices.length === 1 && !selected.features);
if (disabled) {
css += " disabled";
}
return (
<div className={ css } onClick={ handleOpen }>
<div className={ css } onClick={ !disabled ? handleOpen : null }>
<div className="label-container">
<span className="label">{ selected.instanceLabel }</span>
<span className="status">{ deviceStatus }</span>