From ba8a169ef2a25bf1dbb5b78c39399fb1be4de51b Mon Sep 17 00:00:00 2001 From: Adam Shiervani Date: Thu, 20 Nov 2025 17:48:56 +0100 Subject: [PATCH] refactor: remove unused state for log download in FailSafeModeOverlay (#993) --- ui/src/components/FailSafeModeOverlay.tsx | 62 +++++------------------ 1 file changed, 13 insertions(+), 49 deletions(-) diff --git a/ui/src/components/FailSafeModeOverlay.tsx b/ui/src/components/FailSafeModeOverlay.tsx index e85dabee..f60f4216 100644 --- a/ui/src/components/FailSafeModeOverlay.tsx +++ b/ui/src/components/FailSafeModeOverlay.tsx @@ -1,10 +1,9 @@ import { useState } from "react"; import { ExclamationTriangleIcon } from "@heroicons/react/24/solid"; import { motion, AnimatePresence } from "framer-motion"; -import { LuInfo } from "react-icons/lu"; import { Button } from "@/components/Button"; -import Card, { GridCard } from "@components/Card"; +import { GridCard } from "@components/Card"; import { JsonRpcResponse, useJsonRpc } from "@/hooks/useJsonRpc"; import { useDeviceUiNavigation } from "@/hooks/useAppNavigation"; import { useVersion } from "@/hooks/useVersion"; @@ -34,40 +33,12 @@ function OverlayContent({ children }: OverlayContentProps) { ); } -interface TooltipProps { - readonly children: React.ReactNode; - readonly text: string; - readonly show: boolean; -} - -function Tooltip({ children, text, show }: TooltipProps) { - if (!show) { - return <>{children}; - } - - - return ( -
- {children} -
- -
- - {text} -
-
-
-
- ); -} - export function FailSafeModeOverlay({ reason }: FailSafeModeOverlayProps) { const { send } = useJsonRpc(); const { navigateTo } = useDeviceUiNavigation(); const { appVersion } = useVersion(); const { systemVersion } = useDeviceStore(); const [isDownloadingLogs, setIsDownloadingLogs] = useState(false); - const [hasDownloadedLogs, setHasDownloadedLogs] = useState(false); const getReasonCopy = () => { switch (reason) { @@ -115,7 +86,6 @@ export function FailSafeModeOverlay({ reason }: FailSafeModeOverlayProps) { URL.revokeObjectURL(url); notifications.success("Crash logs downloaded successfully"); - setHasDownloadedLogs(true); // Open GitHub issue const issueBody = `## Issue Description @@ -182,25 +152,19 @@ Please attach the recovery logs file that was downloaded to your computer: />
- -