From 4160fc5de2cb6bed3bf0e498987a74212736b390 Mon Sep 17 00:00:00 2001 From: Christian Fehmer Date: Wed, 20 May 2026 22:00:41 +0200 Subject: [PATCH] fix: don't fetch presets twice (@fehmer) (#7986) --- .../ts/components/pages/settings/Settings.tsx | 379 +++++++++--------- 1 file changed, 191 insertions(+), 188 deletions(-) diff --git a/frontend/src/ts/components/pages/settings/Settings.tsx b/frontend/src/ts/components/pages/settings/Settings.tsx index 00a4d908ad40..60b77f96cb5d 100644 --- a/frontend/src/ts/components/pages/settings/Settings.tsx +++ b/frontend/src/ts/components/pages/settings/Settings.tsx @@ -14,7 +14,7 @@ import { } from "../../../controllers/sound-controller"; import { useLocalStorage } from "../../../hooks/useLocalStorage"; import { useSavedIndicator } from "../../../hooks/useSavedIndicator"; -import { isAuthenticated } from "../../../states/core"; +import { getActivePage, isAuthenticated } from "../../../states/core"; import { showModal } from "../../../states/modals"; import { showSimpleModal } from "../../../states/simple-modal"; // import { hotkeys } from "../../../states/hotkeys"; @@ -60,197 +60,200 @@ export function Settings(): JSXElement { () => fileStorage.track("LocalBackgroundFile"), async () => fileStorage.hasFile("LocalBackgroundFile"), ); + const isOpen = (): boolean => getActivePage() === "settings"; return ( -
- - -
- tip: You can also change all these settings quickly using the command - line -
( ) + +
+ + +
+ tip: You can also change all these settings quickly using the + command line +
( ) +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + +
+
+ + + + + + + + + + + + +
+
+ + { + if (option === "off") return; + void previewClick(option); + }} + /> + { + if (option === "off") return; + void previewError(option); + }} + /> + { + if (option === "off") return; + void playTimeWarning(); + }} + /> +
+
+ + + + + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + + + + +
+
+ + + + +
+
+ + + { + showModal("Cookies"); + }} + > + open + + } + /> + + + Resets settings to the default (but doesn't touch your + tags and presets). +
+
You can't undo this!
+
+ } + fa={{ + icon: "fa-undo", + }} + inputs={ + + } + /> +
-
- -
-
- - - - - - - - - - - - - - - - - - - -
-
- - - - - - - - - - - - -
-
- - { - if (option === "off") return; - void previewClick(option); - }} - /> - { - if (option === "off") return; - void previewError(option); - }} - /> - { - if (option === "off") return; - void playTimeWarning(); - }} - /> -
-
- - - - - -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - -
-
- - - - - - - - - -
-
- - - - -
-
- - - { - showModal("Cookies"); - }} - > - open - - } - /> - - - Resets settings to the default (but doesn't touch your tags - and presets). -
-
You can't undo this!
-
- } - fa={{ - icon: "fa-undo", - }} - inputs={ - - } - /> - -
- -
+ + + ); }