diff --git a/apps/web/src/routes/settings.tsx b/apps/web/src/routes/settings.tsx index 45096fd6d6..8bc11ab47f 100644 --- a/apps/web/src/routes/settings.tsx +++ b/apps/web/src/routes/settings.tsx @@ -1,5 +1,5 @@ import { RotateCcwIcon } from "lucide-react"; -import { Outlet, createFileRoute, redirect } from "@tanstack/react-router"; +import { Outlet, createFileRoute, redirect, useLocation } from "@tanstack/react-router"; import { useEffect, useState } from "react"; import { useSettingsRestore } from "../components/settings/SettingsPanels"; @@ -8,10 +8,12 @@ import { SidebarInset, SidebarTrigger } from "../components/ui/sidebar"; import { isElectron } from "../env"; function SettingsContentLayout() { + const location = useLocation(); const [restoreSignal, setRestoreSignal] = useState(0); const { changedSettingLabels, restoreDefaults } = useSettingsRestore(() => setRestoreSignal((value) => value + 1), ); + const showRestoreDefaults = location.pathname === "/settings/general"; useEffect(() => { const onKeyDown = (event: KeyboardEvent) => { @@ -33,9 +35,32 @@ function SettingsContentLayout() {
{!isElectron && (
-
+
Settings + {showRestoreDefaults ? ( +
+ +
+ ) : null} +
+
+ )} + + {isElectron && ( +
+ + Settings + + {showRestoreDefaults ? (
-
- - )} - - {isElectron && ( -
- - Settings - -
- -
+ ) : null}
)}