fix: initialize hash-based test meetings without storage

This commit is contained in:
2026-09-16 21:55:34 +02:00
parent e6fa2e39b2
commit ab83a32d7b
+12 -2
View File
@@ -70,9 +70,19 @@ export function CallRoom({ slug }: { slug: string }) {
const intentionalCloseRef = useRef(false);
useEffect(() => {
const raw = sessionStorage.getItem(MEETING_SESSION_KEY);
const hashToken = new URLSearchParams(window.location.hash.replace(/^#/, "")).get("token");
const rawSession = hashToken ? JSON.stringify({ token: hashToken }) : raw;
let rawSession: string | null = hashToken ? JSON.stringify({ token: hashToken }) : null;
// Hash-based links (for example the admin test call) must work even when
// browser privacy settings deny access to Web Storage.
if (!rawSession) {
try {
rawSession = sessionStorage.getItem(MEETING_SESSION_KEY);
} catch {
rawSession = null;
}
}
if (!rawSession) {
queueMicrotask(() => {
setPhase("error");