mirror of
https://github.com/Moepchi/webspeak3.git
synced 2026-12-03 01:42:50 +08:00
Open Options on a section from an #options/<id> link
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Hu2cuPLqpuKVfd9wWFFakU
This commit is contained in:
1 parent
9a4639f76c
commit
a720f72943
1 file changed
+8
-3
+8
-3
@@ -9138,8 +9138,10 @@ function AppInner() {
|
|||||||
const entry: ClientLogEntry = { id: ++logIdRef.current, timestamp: Date.now(), category, level, message };
|
const entry: ClientLogEntry = { id: ++logIdRef.current, timestamp: Date.now(), category, level, message };
|
||||||
setLogEntries((prev) => [...prev.slice(-(MAX_LOG_ENTRIES - 1)), entry]);
|
setLogEntries((prev) => [...prev.slice(-(MAX_LOG_ENTRIES - 1)), entry]);
|
||||||
};
|
};
|
||||||
const [optionsDialogOpen, setOptionsDialogOpen] = useState(false);
|
// client.webspeak3.de/#options/konto opens Options on that section (shareable link, e.g. for the ticker).
|
||||||
const [optionsSection, setOptionsSection] = useState<string>(OPTIONS_SECTIONS[0].id);
|
const linkedOptionsSection = OPTIONS_SECTIONS.find((s) => window.location.hash === `#options/${s.id}`)?.id;
|
||||||
|
const [optionsDialogOpen, setOptionsDialogOpen] = useState(!!linkedOptionsSection);
|
||||||
|
const [optionsSection, setOptionsSection] = useState<string>(linkedOptionsSection ?? OPTIONS_SECTIONS[0].id);
|
||||||
const socketRef = useRef<WebSocket | DemoSocket | null>(null);
|
const socketRef = useRef<WebSocket | DemoSocket | null>(null);
|
||||||
/** Multi-join: one gateway WebSocket (+ connector) per session tab. */
|
/** Multi-join: one gateway WebSocket (+ connector) per session tab. */
|
||||||
const [sessionTabs, setSessionTabs] = useState<SessionTabInfo[]>([]);
|
const [sessionTabs, setSessionTabs] = useState<SessionTabInfo[]>([]);
|
||||||
@@ -13724,7 +13726,10 @@ function AppInner() {
|
|||||||
onClearCache={handleClearCache}
|
onClearCache={handleClearCache}
|
||||||
section={optionsSection}
|
section={optionsSection}
|
||||||
onSectionChange={setOptionsSection}
|
onSectionChange={setOptionsSection}
|
||||||
onClose={() => setOptionsDialogOpen(false)}
|
onClose={() => {
|
||||||
|
setOptionsDialogOpen(false);
|
||||||
|
if (window.location.hash.startsWith("#options/")) window.history.replaceState(null, "", window.location.pathname + window.location.search);
|
||||||
|
}}
|
||||||
designSelection={designSelection}
|
designSelection={designSelection}
|
||||||
onDesignSelectionChange={handleDesignSelectionChange}
|
onDesignSelectionChange={handleDesignSelectionChange}
|
||||||
customThemes={customThemes}
|
customThemes={customThemes}
|
||||||
|
|||||||
Reference in new issue
Block a user