1
0
mirror of https://github.com/trezor/trezor-wallet synced 2024-12-26 17:08:07 +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) => { const getStatus = (device) => {
let status = 'connected'; let status = 'connected';
if (!device.connected) { if (device.features && device.features.bootloader_mode) {
status = 'connected-bootloader';
} else if (!device.connected) {
status = 'disconnected'; status = 'disconnected';
} else if (!device.available) { } else if (!device.available) {
status = 'unavailable'; status = 'unavailable';
@ -26,6 +28,9 @@ const getStatusName = (deviceStatus) => {
case 'connected': case 'connected':
statusName = 'Connected'; statusName = 'Connected';
break; break;
case 'connected-bootloader':
statusName = 'Connected (bootloader mode)';
break;
case 'disconnected': case 'disconnected':
statusName = 'Disconnected'; statusName = 'Disconnected';
break; break;
@ -51,7 +56,7 @@ const isDisabled = (selectedDevice, devices, transport) => {
if (selectedDevice.features.bootloader_mode || !selectedDevice.features.initialized) return true; // bootlader, not initialized if (selectedDevice.features.bootloader_mode || !selectedDevice.features.initialized) return true; // bootlader, not initialized
} }
return false; // default return false; // default
} };
const getVersion = (device) => { const getVersion = (device) => {
let version; let version;
@ -72,6 +77,9 @@ const getStatusColor = (deviceStatus) => {
case 'connected': case 'connected':
color = colors.GREEN_PRIMARY; color = colors.GREEN_PRIMARY;
break; break;
case 'connected-bootloader':
color = colors.WARNING_PRIMARY;
break;
case 'unacquired': case 'unacquired':
color = colors.WARNING_PRIMARY; color = colors.WARNING_PRIMARY;
break; break;