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

Add text signaling that device is in a bootloader mode

This commit is contained in:
Vasek Mlejnsky 2018-09-27 15:51:33 +02:00
parent af0fcda98b
commit 743ad2556d

View File

@ -2,7 +2,9 @@ import colors from 'config/colors';
const getStatus = (device) => {
let status = 'connected';
if (!device.connected) {
if (device.features && device.features.bootloader_mode) {
status = 'connected-bootloader';
} else if (!device.connected) {
status = 'disconnected';
} else if (!device.available) {
status = 'unavailable';
@ -26,6 +28,9 @@ const getStatusName = (deviceStatus) => {
case 'connected':
statusName = 'Connected';
break;
case 'connected-bootloader':
statusName = 'Connected (bootloader mode)';
break;
case 'disconnected':
statusName = 'Disconnected';
break;
@ -51,7 +56,7 @@ const isDisabled = (selectedDevice, devices, transport) => {
if (selectedDevice.features.bootloader_mode || !selectedDevice.features.initialized) return true; // bootlader, not initialized
}
return false; // default
}
};
const getVersion = (device) => {
let version;
@ -72,6 +77,9 @@ const getStatusColor = (deviceStatus) => {
case 'connected':
color = colors.GREEN_PRIMARY;
break;
case 'connected-bootloader':
color = colors.WARNING_PRIMARY;
break;
case 'unacquired':
color = colors.WARNING_PRIMARY;
break;