Skip to content

Commit

Permalink
fix(suite): show correct step for disconnect event
Browse files Browse the repository at this point in the history
  • Loading branch information
komret committed Apr 30, 2024
1 parent 28afd8a commit 199a5d0
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import * as semver from 'semver';

import { pickByDeviceModel, getFirmwareVersion } from '@trezor/device-utils';
import { H2, Button, ConfirmOnDevice, variables, DeviceAnimation } from '@trezor/components';
import { DEVICE, Device, DeviceModelInternal } from '@trezor/connect';
import { DEVICE, Device, DeviceModelInternal, UI } from '@trezor/connect';
import { Modal, Translation, WebUsbButton } from 'src/components/suite';
import { DeviceConfirmImage } from 'src/components/suite/DeviceConfirmImage';
import { useDevice, useFirmware } from 'src/hooks/suite';
Expand Down Expand Up @@ -183,8 +183,10 @@ export const ReconnectDevicePrompt = ({ onClose, onSuccess }: ReconnectDevicePro
) {
return 'done';
}
const rebootToBootloaderNotSupported = uiEvent?.type === UI.FIRMWARE_DISCONNECT;
const rebootToBootloaderCancelled = device?.connected && device?.mode !== 'bootloader';

return device?.connected && device?.mode !== 'bootloader'
return rebootToBootloaderNotSupported || rebootToBootloaderCancelled
? 'waiting-for-reboot'
: 'disconnected';
};
Expand Down

0 comments on commit 199a5d0

Please sign in to comment.