diff --git a/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/WipeDeviceModal.tsx b/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/WipeDeviceModal.tsx index 709136ad7d6..3170ea5aee9 100644 --- a/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/WipeDeviceModal.tsx +++ b/packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/WipeDeviceModal.tsx @@ -2,6 +2,7 @@ import { useState } from 'react'; import { NewModal, Card, Column, H3, Paragraph } from '@trezor/components'; import { spacings } from '@trezor/theme'; +import { isDeviceInBootloaderMode } from '@trezor/device-utils'; import { Translation, CheckItem } from 'src/components/suite'; import { wipeDevice } from 'src/actions/settings/deviceSettingsActions'; @@ -15,12 +16,17 @@ export const WipeDeviceModal = ({ onCancel }: WipeDeviceModalProps) => { const [checkbox1, setCheckbox1] = useState(false); const [checkbox2, setCheckbox2] = useState(false); + const { device, isLocked } = useDevice(); const dispatch = useDispatch(); - const { isLocked } = useDevice(); + const isBootloaderMode = isDeviceInBootloaderMode(device); const handleWipeDevice = () => dispatch(wipeDevice()); + const headingTranslation = isBootloaderMode + ? 'TR_DEVICE_SETTINGS_FACTORY_RESET' + : 'TR_DEVICE_SETTINGS_WIPE_DEVICE'; + return ( { isDisabled={isLocked() || !checkbox1 || !checkbox2} data-testid="@wipe/wipe-button" > - + @@ -44,7 +50,7 @@ export const WipeDeviceModal = ({ onCancel }: WipeDeviceModalProps) => { } >

- +

diff --git a/packages/suite/src/support/messages.ts b/packages/suite/src/support/messages.ts index eadaa76e8dd..7cf463c1d89 100644 --- a/packages/suite/src/support/messages.ts +++ b/packages/suite/src/support/messages.ts @@ -2093,9 +2093,13 @@ export default defineMessages({ defaultMessage: 'Security', id: 'TR_DEVICE_SECURITY', }, - TR_DEVICE_SETTINGS_BUTTON_WIPE_DEVICE: { + TR_DEVICE_SETTINGS_FACTORY_RESET: { defaultMessage: 'Factory reset', - id: 'TR_DEVICE_SETTINGS_BUTTON_WIPE_DEVICE', + id: 'TR_DEVICE_SETTINGS_FACTORY_RESET', + }, + TR_DEVICE_SETTINGS_WIPE_DEVICE: { + defaultMessage: 'Wipe device', + id: 'TR_DEVICE_SETTINGS_WIPE_DEVICE', }, TR_DEVICE_SETTINGS_CUSTOM_FIRMWARE_BUTTON: { defaultMessage: 'Install firmware', @@ -3335,10 +3339,15 @@ export default defineMessages({ defaultMessage: 'Learn more about the difference', id: 'TR_WHAT_IS_PASSPHRASE', }, - TR_WIPING_YOUR_DEVICE: { + TR_FACTORY_RESET_DESCRIPTION: { + defaultMessage: + 'Performing a factory reset in bootloader mode will erase all device data, including the wallet backup, PIN, and firmware. Without your wallet backup, any funds stored on the device will be lost forever. Ensure you have your backup on hand, as it’s required to restore access to your funds after the reset. Only proceed if you’re fully prepared.', + id: 'TR_FACTORY_RESET_DESCRIPTION', + }, + TR_WIPE_DEVICE_DESCRIPTION: { defaultMessage: - 'Factory reset wipes the device memory, erasing all information including the wallet backup and PIN. Only perform a factory reset if you have your wallet backup, which is needed to restore access to your funds.', - id: 'TR_WIPING_YOUR_DEVICE', + 'Wiping the device will permanently erase all stored data, including the wallet backup and PIN. If you do not have your wallet backup, any funds on the device will be lost forever. Ensure you have your backup available before wiping the device, as it is essential for restoring access to your funds. Proceed with caution.', + id: 'TR_WIPE_DEVICE_DESCRIPTION', }, TR_WORDS: { defaultMessage: '{count} words', diff --git a/packages/suite/src/views/settings/SettingsDevice/WipeDevice.tsx b/packages/suite/src/views/settings/SettingsDevice/WipeDevice.tsx index 4a3d82d034b..98817e2d5a6 100644 --- a/packages/suite/src/views/settings/SettingsDevice/WipeDevice.tsx +++ b/packages/suite/src/views/settings/SettingsDevice/WipeDevice.tsx @@ -1,6 +1,8 @@ +import { isDeviceInBootloaderMode } from '@trezor/device-utils'; + import { SettingsSectionItem } from 'src/components/settings'; import { ActionButton, ActionColumn, TextColumn, Translation } from 'src/components/suite'; -import { useDispatch } from 'src/hooks/suite'; +import { useDevice, useDispatch } from 'src/hooks/suite'; import { openModal } from 'src/actions/suite/modalActions'; import { SettingsAnchor } from 'src/constants/suite/anchors'; @@ -9,15 +11,30 @@ interface WipeDeviceProps { } export const WipeDevice = ({ isDeviceLocked }: WipeDeviceProps) => { + const { device } = useDevice(); const dispatch = useDispatch(); + const isBootloaderMode = isDeviceInBootloaderMode(device); + const handleClick = () => dispatch(openModal({ type: 'wipe-device' })); + const headingTranslation = isBootloaderMode + ? 'TR_DEVICE_SETTINGS_FACTORY_RESET' + : 'TR_DEVICE_SETTINGS_WIPE_DEVICE'; + return ( } - description={} + title={} + description={ + + } /> { isDisabled={isDeviceLocked} data-testid="@settings/device/open-wipe-modal-button" > - +