From eba1e1af92914bd6a856216949794504050183de Mon Sep 17 00:00:00 2001 From: Moepchi Date: Sun, 27 Sep 2026 19:20:47 +0000 Subject: [PATCH] Web: smaller review fixes (A10-A19, S10, S11, lint) - A10: drop labels of unimplemented shortcuts, localize "Ctrl", never fire shortcuts (Ctrl+D!) while typing in a field - A11: in-memory localStorage stand-in when storage is blocked instead of a blank page - A12: invite link falls back to selecting the text without clipboard API - A13: AEC3 script honors BASE_URL, failed loads are retried - A14: shared downloadBlob helper, object URLs revoked with a delay - A15: remaining hardcoded German/English strings moved to the locales - A16: broken soundpack files show an error instead of failing silently - A17: connect buttons no longer pass the click event as overrides - A18: design base persisted from the resolved theme - A19: no audio send() while the socket is still connecting - S10: privilege keys are no longer persisted in localStorage - S11: share links can carry the token in the fragment (#token=) - oxlint: 0 warnings Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01Hu2cuPLqpuKVfd9wWFFakU --- README.md | 4 +- web/src/App.tsx | 179 ++++++++++-------- web/src/aec3.ts | 15 +- web/src/i18n.tsx | 1 + web/src/lib/spacer.ts | 2 +- web/src/locales/de.json | 12 +- web/src/locales/en.json | 12 +- web/src/locales/fa.json | 12 +- web/src/locales/zh-CN.json | 12 +- web/src/main.tsx | 1 + web/src/storageFallback.ts | 22 +++ .../greenteaspeak/GreenteaSpeakChrome.tsx | 8 +- 12 files changed, 182 insertions(+), 98 deletions(-) create mode 100644 web/src/storageFallback.ts diff --git a/README.md b/README.md index 358c715..4e21359 100644 --- a/README.md +++ b/README.md @@ -293,7 +293,7 @@ Skip the connect dialog entirely and drop visitors straight into a TeamSpeak ser Add a `connect` parameter to your instance's URL and send that link out — in a Discord post, a landing page button, a QR code, wherever: ``` -https://your-instance/?connect=voice.example.com&nickname=Guest&channel=Lobby&token=abc123 +https://your-instance/?connect=voice.example.com&nickname=Guest&channel=Lobby#token=abc123 ``` | Parameter | Required | What it does | @@ -301,7 +301,7 @@ https://your-instance/?connect=voice.example.com&nickname=Guest&channel=Lobby&to | `connect` | yes | Server address to join, `host` or `host:port` | | `nickname` | no | Nickname to connect with — omit it and the visitor gets an auto-generated `Guest-XXXX` | | `channel` | no | Default channel to join | -| `token` | no | Server/channel privilege key, if the target requires one | +| `token` | no | Server/channel privilege key, if the target requires one. Put it after `#` (as above) so it never reaches server logs or `Referer` headers; `?token=` still works too | This works on **any** deployment — no rebuild, no configuration. WebSpeak3 connects as soon as the page loads and immediately strips these parameters from the address bar, so refreshing the tab (or someone screenshotting/forwarding the URL later) won't silently reconnect off a stale link. diff --git a/web/src/App.tsx b/web/src/App.tsx index 5aa226f..01692f0 100644 --- a/web/src/App.tsx +++ b/web/src/App.tsx @@ -137,17 +137,25 @@ const IS_OWN_HOSTED_INSTANCE = !DEMO_MODE && OWN_HOSTED_HOSTNAMES.has(window.loc // reconnect off a stale link sitting in the address bar or browser history. const AUTO_CONNECT_FROM_URL = (() => { const params = new URLSearchParams(window.location.search); + // The token may also sit in the fragment (#token=...), which - unlike the + // query - never reaches server logs or Referer headers. + const hashParams = new URLSearchParams(window.location.hash.slice(1)); const connectHost = params.get("connect"); if (!connectHost) return null; const target = { host: connectHost, nickname: params.get("nickname") || undefined, defaultChannel: params.get("channel") || undefined, - privilegeKey: params.get("token") || undefined, + privilegeKey: hashParams.get("token") || params.get("token") || undefined, }; for (const key of ["connect", "nickname", "channel", "token"]) params.delete(key); + let hash = window.location.hash; + if (hashParams.has("token")) { + hashParams.delete("token"); + hash = hashParams.size ? `#${hashParams}` : ""; + } const rest = params.toString(); - window.history.replaceState(null, "", window.location.pathname + (rest ? `?${rest}` : "") + window.location.hash); + window.history.replaceState(null, "", window.location.pathname + (rest ? `?${rest}` : "") + hash); return target; })(); @@ -184,7 +192,9 @@ function hasAcceptedToS(): boolean { const LAST_HOST_KEY = "webspeak3:last-host"; const LAST_NICKNAME_KEY = "webspeak3:last-nickname"; -const LAST_PRIVILEGE_KEY = "webspeak3:last-privilege-key"; +// Privilege keys are one-shot grants, so they're no longer remembered across +// reloads; drop what older versions stored in plain text. +localStorage.removeItem("webspeak3:last-privilege-key"); const LAST_SERVER_TYPE_KEY = "webspeak3:last-server-type"; type ServerType = "teamspeak" | "teaspeak" | "auto"; @@ -715,15 +725,19 @@ function triggerBrowserDownload(filename: string, base64Data: string): void { const binary = atob(base64Data); const bytes = new Uint8Array(binary.length); for (let i = 0; i < binary.length; i++) bytes[i] = binary.charCodeAt(i); - const blob = new Blob([bytes]); + downloadBlob(new Blob([bytes]), filename); +} + +function downloadBlob(blob: Blob, filename: string) { const url = URL.createObjectURL(blob); const a = document.createElement("a"); a.href = url; a.download = filename; document.body.appendChild(a); a.click(); - document.body.removeChild(a); - URL.revokeObjectURL(url); + a.remove(); + // Revoking right after click() can cancel the download in some browsers. + setTimeout(() => URL.revokeObjectURL(url), 60_000); } function formatDurationSecs(totalSeconds: number): string { @@ -874,7 +888,6 @@ function ChannelTree({ onSelectItem, onSwitchChannel, onOpenPrivateChat, - onPokeClient, onMoveClient, onClientContextMenu, onChannelContextMenu, @@ -893,7 +906,6 @@ function ChannelTree({ onSelectItem: (item: SelectedItem) => void; onSwitchChannel: (channelId: number) => void; onOpenPrivateChat: (clientId: number, clientName: string) => void; - onPokeClient: (clientId: number, clientName: string) => void; onMoveClient: (clientId: number, channelId: number) => void; onClientContextMenu: (e: React.MouseEvent, clientId: number, clientName: string, isSelf: boolean) => void; onChannelContextMenu: (e: React.MouseEvent, channelId: number, channelName: string) => void; @@ -989,7 +1001,7 @@ function ChannelTree({ className={`ts-tree-expander${hasChildren ? "" : " ts-tree-expander-empty"}${ isCollapsed ? " ts-tree-expander-collapsed" : "" }`} - aria-label={isCollapsed ? "aufklappen" : "zuklappen"} + aria-label={isCollapsed ? t("tree.expand") : t("tree.collapse")} tabIndex={-1} onMouseDown={(e) => { // Keep focus on the row so a nearby double-click still joins. @@ -1131,7 +1143,6 @@ function ChannelTree({ onSelectItem={onSelectItem} onSwitchChannel={onSwitchChannel} onOpenPrivateChat={onOpenPrivateChat} - onPokeClient={onPokeClient} onMoveClient={onMoveClient} onClientContextMenu={onClientContextMenu} onChannelContextMenu={onChannelContextMenu} @@ -1498,7 +1509,7 @@ function ConnectDialog({
@@ -2748,6 +2759,7 @@ function InviteFriendDialog({ const t = useT(); const [includeChannel, setIncludeChannel] = useState(false); const [copied, setCopied] = useState(false); + const linkInputRef = useRef(null); const backdrop = useBackdropDismiss(onClose); const link = `ts3server://${host}${includeChannel && channelId !== null ? `?channel=${channelId}` : ""}`; @@ -2781,7 +2793,7 @@ function InviteFriendDialog({
@@ -2791,9 +2803,15 @@ function InviteFriendDialog({
+ {soundpackFailed &&

{t("sounds.importFailed")}

} {soundpackResult && (

{t("sounds.importResult", { @@ -6337,9 +6360,7 @@ function AppInner() { const [serverPassword, setServerPassword] = useState(""); const [channelPassword, setChannelPassword] = useState(""); const [defaultChannel, setDefaultChannel] = useState(""); - const [privilegeKey, setPrivilegeKey] = useState( - () => localStorage.getItem(LAST_PRIVILEGE_KEY) ?? "" - ); + const [privilegeKey, setPrivilegeKey] = useState(""); const [serverType, setServerType] = useState(loadServerType); // Prompt shown when switching into a password-protected channel mid-session // (the initial-connect "default channel" password above is a separate field). @@ -6499,8 +6520,12 @@ function AppInner() { const handleDesignSelectionChange = (next: string) => { setDesignSelection(next); localStorage.setItem(DESIGN_SELECTION_KEY, next); - localStorage.setItem(DESIGN_THEME_KEY, resolveDesignThemeBase(next, customThemes)); }; + // Persisted from the resolved value, not in the handler: a theme selected + // right after being created/installed isn't in the handler's customThemes yet. + useEffect(() => { + localStorage.setItem(DESIGN_THEME_KEY, designTheme); + }, [designTheme]); const handleSaveCustomTheme = (nextTheme: CustomTheme) => { setCustomThemes((prev) => { const idx = prev.findIndex((th) => th.id === nextTheme.id); @@ -6799,15 +6824,16 @@ function AppInner() { }, [activeSessionId]); useEffect(() => { + const sessions = sessionsRef.current; return () => { - for (const rec of sessionsRef.current.values()) { + for (const rec of sessions.values()) { try { rec.socket?.close(); } catch { /* ignore */ } } - sessionsRef.current.clear(); + sessions.clear(); }; }, []); @@ -7103,7 +7129,7 @@ function AppInner() { } if (rec) { try { - rec.socket && ((rec.socket as WebSocket).onmessage = null); + if (rec.socket) (rec.socket as WebSocket).onmessage = null; } catch { /* ignore */ } @@ -7242,7 +7268,6 @@ function AppInner() { }); localStorage.setItem(LAST_HOST_KEY, connectHost); localStorage.setItem(LAST_NICKNAME_KEY, connectNickname); - localStorage.setItem(LAST_PRIVILEGE_KEY, connectPrivilegeKey); localStorage.setItem(LAST_SERVER_TYPE_KEY, connectServerType); if (connectIdentityId) { setIdentities((prev) => @@ -8159,6 +8184,9 @@ function AppInner() { ...prevLog, { id: ++whisperLogIdRef.current, timestamp: Date.now(), description }, ]); + // Only a change of whisper targets should log; channels/clients/t are + // read for the description but must not re-trigger it (renames, joins). + // eslint-disable-next-line react-hooks/exhaustive-deps }, [whisperChannelIds, whisperClientIds, connected]); useEffect(() => { @@ -8241,23 +8269,30 @@ function AppInner() { }; }, [rightsMenuOpen]); + // Rebuilt each render and read through the ref, so the listener below is + // registered once yet always sees current state. + const shortcutHandlerRef = useRef<(e: KeyboardEvent) => void>(() => {}); + shortcutHandlerRef.current = (e: KeyboardEvent) => { + if (!e.ctrlKey) return; + // Typing in a field (chat, dialogs) must never trigger e.g. Ctrl+D. + const el = e.target as HTMLElement | null; + if (el && (el.isContentEditable || /^(INPUT|TEXTAREA|SELECT)$/.test(el.tagName))) return; + if (e.key.toLowerCase() === "s" && !connecting) { + e.preventDefault(); + setConnectDialogOpen(true); + } else if (e.key.toLowerCase() === "d" && (connected || sessionTabs.length > 0)) { + e.preventDefault(); + handleDisconnect(); + } else if (e.key.toLowerCase() === "b") { + e.preventDefault(); + openAddFavorite(); + } + }; useEffect(() => { - const onKeyDown = (e: KeyboardEvent) => { - if (!e.ctrlKey) return; - if (e.key.toLowerCase() === "s" && !connecting) { - e.preventDefault(); - setConnectDialogOpen(true); - } else if (e.key.toLowerCase() === "d" && (connected || sessionTabs.length > 0)) { - e.preventDefault(); - handleDisconnect(); - } else if (e.key.toLowerCase() === "b") { - e.preventDefault(); - openAddFavorite(); - } - }; + const onKeyDown = (e: KeyboardEvent) => shortcutHandlerRef.current(e); window.addEventListener("keydown", onKeyDown); return () => window.removeEventListener("keydown", onKeyDown); - }, [connected, connecting, sessionTabs.length, host, nickname, serverPassword, defaultChannel, channelPassword]); + }, []); // Nova-theme-only: the connect dialog IS the app until a connection exists - // it's forced open on load and after every disconnect, and closes itself the @@ -8299,7 +8334,10 @@ function AppInner() { try { mic = new MicCapture(audioContext, { onFrame: (pcm) => { - if (!inputMutedRef.current) socketRef.current?.send(JSON.stringify({ type: "sendAudio", pcm })); + // A reconnecting socket is still CONNECTING, where send() throws. + if (!inputMutedRef.current && socketRef.current?.readyState === WebSocket.OPEN) { + socketRef.current.send(JSON.stringify({ type: "sendAudio", pcm })); + } }, onActivity: (active) => setSelfActive(active), onLevel: (rms) => { @@ -8499,14 +8537,7 @@ function AppInner() { const blob = encodeWavStereo(mergedLeft, mergedRight, audioContextRef.current?.sampleRate ?? SAMPLE_RATE); const safeServerName = (serverName || "session").replace(/[\\/:*?"<>|]+/g, "_").trim() || "session"; const filename = `webspeak3-${safeServerName}-${new Date().toISOString().replace(/[:.]/g, "-")}.wav`; - const url = URL.createObjectURL(blob); - const a = document.createElement("a"); - a.href = url; - a.download = filename; - document.body.appendChild(a); - a.click(); - a.remove(); - URL.revokeObjectURL(url); + downloadBlob(blob, filename); logClient("info", "Recording", `Saved recording as ${filename}`); }; @@ -8702,14 +8733,7 @@ function AppInner() { const identity = identities.find((i) => i.id === id); if (!identity?.blob) return; const blob = new Blob([identity.blob], { type: "application/json" }); - const url = URL.createObjectURL(blob); - const a = document.createElement("a"); - a.href = url; - a.download = `${identity.name.replace(/[^a-z0-9_-]+/gi, "_") || "identity"}.ts3identity.json`; - document.body.appendChild(a); - a.click(); - document.body.removeChild(a); - URL.revokeObjectURL(url); + downloadBlob(blob, `${identity.name.replace(/[^a-z0-9_-]+/gi, "_") || "identity"}.ts3identity.json`); }; /** Parses the native client's identity .ini format: @@ -8799,7 +8823,7 @@ function AppInner() { try { JSON.parse(text); } catch { - logClient("error", "Identitäten", `"${file.name}" ist keine gültige Identitätsdatei.`); + logClient("error", "Identities", t("identity.importInvalid", { file: file.name })); return; } const name = file.name.replace(/\.(ts3identity\.)?json$/i, "") || t("identities.newName"); @@ -9431,7 +9455,7 @@ function AppInner() { > 🟢 {t("menu.connections.connect")} - Strg+S + {t("shortcut.ctrl")}+S

)} @@ -10193,8 +10205,8 @@ function AppInner() { onServerTypeChange={setServerType} onActiveIdentityChange={handleActiveIdentityChange} onToggleExpanded={() => setConnectDialogExpanded((v) => !v)} - onConnect={handleConnect} - onConnectNewTab={handleConnect} + onConnect={() => handleConnect()} + onConnectNewTab={() => handleConnect()} canOpenNewTab={sessionTabs.length > 0 || connected} onCancel={novaSplash ? () => {} : () => setConnectDialogOpen(false)} nova={designTheme === "nova"} @@ -11078,7 +11090,6 @@ function AppInner() { onSelectItem={handleSelectItem} onSwitchChannel={handleSwitchChannel} onOpenPrivateChat={handleOpenPrivateChat} - onPokeClient={handlePokeClient} onMoveClient={handleMoveClient} onClientContextMenu={handleClientContextMenu} onChannelContextMenu={handleChannelContextMenu} @@ -11231,9 +11242,9 @@ function AppInner() { {log.slice(-50).map((entry, i) => { let text = entry.text; if (/os[- ]?error\s*10049/i.test(text) || /angeforderte Adresse ist in diesem Kontext ungültig/i.test(text)) { - text = "File-Transfer fehlgeschlagen (ungültige Adresse)"; + text = t("log.fileTransferInvalidAddress"); } else { - text = text.replace(/^(file transfer failed:\s*)+/i, "File-Transfer fehlgeschlagen: "); + text = text.replace(/^(file transfer failed:\s*)+/i, `${t("log.fileTransferFailed")} `); } return (
diff --git a/web/src/aec3.ts b/web/src/aec3.ts index 8176f34..4b8b138 100644 --- a/web/src/aec3.ts +++ b/web/src/aec3.ts @@ -37,10 +37,17 @@ function loadScript(src: string): Promise { function loadModule(): Promise { if (!modulePromise) { - modulePromise = loadScript("/vendor/webrtcaec3.js").then(() => { - if (!window.WebRtcAec3) throw new Error("AEC3 script loaded but did not register window.WebRtcAec3"); - return window.WebRtcAec3(); - }); + // BASE_URL keeps sub-path deployments (VITE_BASE_PATH) working; a failed + // load is forgotten so the next attempt retries instead of reusing it. + modulePromise = loadScript(`${import.meta.env.BASE_URL}vendor/webrtcaec3.js`) + .then(() => { + if (!window.WebRtcAec3) throw new Error("AEC3 script loaded but did not register window.WebRtcAec3"); + return window.WebRtcAec3(); + }) + .catch((err) => { + modulePromise = null; + throw err; + }); } return modulePromise; } diff --git a/web/src/i18n.tsx b/web/src/i18n.tsx index 0c0a69d..733f55c 100644 --- a/web/src/i18n.tsx +++ b/web/src/i18n.tsx @@ -1,3 +1,4 @@ +/* eslint-disable react/only-export-components -- provider and its hooks belong together; only costs fast refresh */ import { createContext, useContext, useEffect, useState, type ReactNode } from "react"; import de from "./locales/de.json"; import en from "./locales/en.json"; diff --git a/web/src/lib/spacer.ts b/web/src/lib/spacer.ts index 59880e8..3c68efe 100644 --- a/web/src/lib/spacer.ts +++ b/web/src/lib/spacer.ts @@ -15,7 +15,7 @@ export type ParsedChannelName = { }; /** Pure line fillers that look better as a CSS rule than raw `---` / `***`. */ -const LINE_FILLER_RE = /^[\-\u2013\u2014\u2500\u2501\u2550=\*\.·_\s]+$/; +const LINE_FILLER_RE = /^[-\u2013\u2014\u2500\u2501\u2550=*.·_\s]+$/; /** Corners / verticals of box-frame spacers (not pure horizontal fills). */ const BOX_FRAME_RE = /[╔╗╚╝╒╓╕╖╘╙╛╜┌┐└┘├┤┬┴┼║│╟╢╤╧╪╫╬╒╓╕╖╘╙╛╜]/; diff --git a/web/src/locales/de.json b/web/src/locales/de.json index 46814b1..aa01180 100644 --- a/web/src/locales/de.json +++ b/web/src/locales/de.json @@ -648,5 +648,15 @@ "nachrichten.templateName": "Vorlagenname", "nachrichten.message": "Nachricht", "nachrichten.add": "Hinzufügen", - "nachrichten.delete": "Löschen" + "nachrichten.delete": "Löschen", + "tree.expand": "Aufklappen", + "tree.collapse": "Zuklappen", + "tabs.disconnect": "Verbindung trennen", + "tabs.closeTab": "Tab schließen: {label}", + "identity.importInvalid": "„{file}“ ist keine gültige Identitätsdatei.", + "log.fileTransferFailed": "Dateiübertragung fehlgeschlagen:", + "log.fileTransferInvalidAddress": "Dateiübertragung fehlgeschlagen (ungültige Adresse)", + "sounds.importFailed": "Das Soundpack konnte nicht gelesen werden – ist es eine gültige .ts3soundpack-/ZIP-Datei?", + "tabs.connections": "Server-Verbindungen", + "shortcut.ctrl": "Strg" } diff --git a/web/src/locales/en.json b/web/src/locales/en.json index 0a774d6..44558c6 100644 --- a/web/src/locales/en.json +++ b/web/src/locales/en.json @@ -648,5 +648,15 @@ "nachrichten.templateName": "Template name", "nachrichten.message": "Message", "nachrichten.add": "Add", - "nachrichten.delete": "Delete" + "nachrichten.delete": "Delete", + "tree.expand": "Expand", + "tree.collapse": "Collapse", + "tabs.disconnect": "Disconnect", + "tabs.closeTab": "Close tab: {label}", + "identity.importInvalid": "\"{file}\" is not a valid identity file.", + "log.fileTransferFailed": "File transfer failed:", + "log.fileTransferInvalidAddress": "File transfer failed (invalid address)", + "sounds.importFailed": "Could not read this soundpack - is it a valid .ts3soundpack/ZIP file?", + "tabs.connections": "Server connections", + "shortcut.ctrl": "Ctrl" } diff --git a/web/src/locales/fa.json b/web/src/locales/fa.json index d64f0f5..39e8f8c 100644 --- a/web/src/locales/fa.json +++ b/web/src/locales/fa.json @@ -647,5 +647,15 @@ "nachrichten.templateName": "نام الگو", "nachrichten.message": "پیام", "nachrichten.add": "افزودن", - "nachrichten.delete": "حذف" + "nachrichten.delete": "حذف", + "tree.expand": "باز کردن", + "tree.collapse": "بستن", + "tabs.disconnect": "قطع اتصال", + "tabs.closeTab": "بستن زبانه: {label}", + "identity.importInvalid": "«{file}» یک فایل هویت معتبر نیست.", + "log.fileTransferFailed": "انتقال فایل ناموفق بود:", + "log.fileTransferInvalidAddress": "انتقال فایل ناموفق بود (نشانی نامعتبر)", + "sounds.importFailed": "این بسته صدا خوانده نشد - آیا یک فایل ‎.ts3soundpack/ZIP معتبر است؟", + "tabs.connections": "اتصال‌های سرور", + "shortcut.ctrl": "Ctrl" } diff --git a/web/src/locales/zh-CN.json b/web/src/locales/zh-CN.json index a86c0d2..cd9885c 100644 --- a/web/src/locales/zh-CN.json +++ b/web/src/locales/zh-CN.json @@ -647,5 +647,15 @@ "stream.state.disconnected": "连接中断", "stream.state.failed": "连接失败", "stream.state.closed": "已结束", - "clientContext.watchStream": "观看直播" + "clientContext.watchStream": "观看直播", + "tree.expand": "展开", + "tree.collapse": "折叠", + "tabs.disconnect": "断开连接", + "tabs.closeTab": "关闭标签页:{label}", + "identity.importInvalid": "“{file}”不是有效的身份文件。", + "log.fileTransferFailed": "文件传输失败:", + "log.fileTransferInvalidAddress": "文件传输失败(地址无效)", + "sounds.importFailed": "无法读取此音效包——它是有效的 .ts3soundpack/ZIP 文件吗?", + "tabs.connections": "服务器连接", + "shortcut.ctrl": "Ctrl" } diff --git a/web/src/main.tsx b/web/src/main.tsx index 74e0b50..5c3cfe5 100644 --- a/web/src/main.tsx +++ b/web/src/main.tsx @@ -1,3 +1,4 @@ +import './storageFallback' import { StrictMode } from 'react' import { createRoot } from 'react-dom/client' import './index.css' diff --git a/web/src/storageFallback.ts b/web/src/storageFallback.ts new file mode 100644 index 0000000..8d87a7c --- /dev/null +++ b/web/src/storageFallback.ts @@ -0,0 +1,22 @@ +// With storage blocked (privacy settings, some embedded webviews) merely +// touching `localStorage` throws, and dozens of module-level reads would +// leave a blank page. Swap in an in-memory stand-in so the app runs; settings +// just don't survive a reload then. Imported first thing in main.tsx. +try { + const probe = "__webspeak3_probe__"; + localStorage.setItem(probe, probe); + localStorage.removeItem(probe); +} catch { + const data = new Map(); + const memory: Storage = { + get length() { + return data.size; + }, + key: (i) => [...data.keys()][i] ?? null, + getItem: (k) => data.get(k) ?? null, + setItem: (k, v) => void data.set(k, String(v)), + removeItem: (k) => void data.delete(k), + clear: () => data.clear(), + }; + Object.defineProperty(window, "localStorage", { value: memory, configurable: true }); +} diff --git a/web/src/themes/greenteaspeak/GreenteaSpeakChrome.tsx b/web/src/themes/greenteaspeak/GreenteaSpeakChrome.tsx index e0a9291..5467af2 100644 --- a/web/src/themes/greenteaspeak/GreenteaSpeakChrome.tsx +++ b/web/src/themes/greenteaspeak/GreenteaSpeakChrome.tsx @@ -1,4 +1,5 @@ import type { ReactNode } from "react"; +import { useT } from "../../i18n"; export type ConnectionTabItem = { id: string; @@ -39,11 +40,12 @@ export function GreenteaSpeakChrome({ : []); const hasTabs = resolvedTabs.length > 0; + const t = useT(); return ( <> {hasTabs ? ( -
+
{resolvedTabs.map((tab) => { const isActive = tab.id === (activeTabId ?? resolvedTabs[0]?.id); return ( @@ -62,8 +64,8 @@ export function GreenteaSpeakChrome({