From 7a5ca9c67a0c714e027313ebc81bb6ba9bb51c66 Mon Sep 17 00:00:00 2001 From: ByteZhang Date: Mon, 22 Jul 2024 17:10:54 +0800 Subject: [PATCH] chore: optimize reboot button --- src/components/Firmware/Firmware.tsx | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/src/components/Firmware/Firmware.tsx b/src/components/Firmware/Firmware.tsx index b57c58f..7e995f4 100644 --- a/src/components/Firmware/Firmware.tsx +++ b/src/components/Firmware/Firmware.tsx @@ -93,6 +93,7 @@ const RebootToBoard: FC = () => { const intl = useIntl(); const device = useSelector((state: RootState) => state.runtime.device); const [loading, setLoading] = useState(false); + const isBootLoader = device?.features?.bootloader_mode; const onRebootToBoard = useCallback(async () => { setLoading(true); @@ -100,10 +101,18 @@ const RebootToBoard: FC = () => { setLoading(false); }, []); - if (['touch', 'pro'].includes(getDeviceType(device?.features))) { + if ( + !isBootLoader && + ['touch', 'pro'].includes(getDeviceType(device?.features)) + ) { return ( -
-