fix: initialize hash-based test meetings without storage
This commit is contained in:
@@ -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");
|
||||
|
||||
Reference in New Issue
Block a user