refactor: remove unused state for log download in FailSafeModeOverlay

This commit is contained in:
Adam Shiervani 2025-11-20 17:31:58 +01:00
parent 641b03199e
commit d9918cbe9f
1 changed files with 12 additions and 20 deletions

View File

@ -67,7 +67,6 @@ export function FailSafeModeOverlay({ reason }: FailSafeModeOverlayProps) {
const { appVersion } = useVersion(); const { appVersion } = useVersion();
const { systemVersion } = useDeviceStore(); const { systemVersion } = useDeviceStore();
const [isDownloadingLogs, setIsDownloadingLogs] = useState(false); const [isDownloadingLogs, setIsDownloadingLogs] = useState(false);
const [hasDownloadedLogs, setHasDownloadedLogs] = useState(false);
const getReasonCopy = () => { const getReasonCopy = () => {
switch (reason) { switch (reason) {
@ -115,7 +114,6 @@ export function FailSafeModeOverlay({ reason }: FailSafeModeOverlayProps) {
URL.revokeObjectURL(url); URL.revokeObjectURL(url);
notifications.success("Crash logs downloaded successfully"); notifications.success("Crash logs downloaded successfully");
setHasDownloadedLogs(true);
// Open GitHub issue // Open GitHub issue
const issueBody = `## Issue Description const issueBody = `## Issue Description
@ -182,25 +180,19 @@ Please attach the recovery logs file that was downloaded to your computer:
/> />
<div className="h-8 w-px bg-slate-200 dark:bg-slate-700 block" /> <div className="h-8 w-px bg-slate-200 dark:bg-slate-700 block" />
<Tooltip text="Download logs first" show={!hasDownloadedLogs}> <Button
<Button onClick={() => navigateTo("/settings/general/reboot")}
onClick={() => navigateTo("/settings/general/reboot")} theme="light"
theme="light" size="SM"
size="SM" text="Reboot Device"
text="Reboot Device" />
disabled={!hasDownloadedLogs}
/>
</Tooltip>
<Tooltip text="Download logs first" show={!hasDownloadedLogs}> <Button
<Button size="SM"
size="SM" onClick={handleDowngrade}
onClick={handleDowngrade} theme="light"
theme="light" text={`Downgrade to v${DOWNGRADE_VERSION}`}
text={`Downgrade to v${DOWNGRADE_VERSION}`} />
disabled={!hasDownloadedLogs}
/>
</Tooltip>
</div> </div>