This commit is contained in:
k
2026-09-24 11:02:24 +02:00
parent 8e64c0c963
commit 6e65d84a1c
17 changed files with 2141 additions and 191 deletions
+8
View File
@@ -23,6 +23,14 @@ export function chatIdFromPath(pathname: string): string | null {
return m ? decodeURIComponent(m[1]!) : null;
}
/** Admin section from /admin itself (null) or /admin/<tab>. */
export function adminTabFromPath(pathname: string): string | null {
const p = normalizePath(pathname);
if (p === "/admin") return null;
const m = p.match(/^\/admin\/([^/]+)$/);
return m ? decodeURIComponent(m[1]!) : null;
}
/** Client-side navigation without reload (same-origin path only). */
export function navigate(to: string, replace = false): void {
const dest = normalizePath(to);