mirror of
https://github.com/Monadical-SAS/reflector.git
synced 2025-12-20 12:19:06 +00:00
Fix room not found error
This commit is contained in:
@@ -5,6 +5,7 @@ import { useCallback, useEffect, useRef, useState } from "react";
|
||||
import { Box, Button, Text, VStack, HStack, Spinner } from "@chakra-ui/react";
|
||||
import useRoomMeeting from "./useRoomMeeting";
|
||||
import { useRouter } from "next/navigation";
|
||||
import { notFound } from "next/navigation";
|
||||
import useSessionStatus from "../lib/useSessionStatus";
|
||||
|
||||
export type RoomDetails = {
|
||||
@@ -34,6 +35,17 @@ export default function Room(details: RoomDetails) {
|
||||
setConsentGiven(consent);
|
||||
};
|
||||
|
||||
useEffect(() => {
|
||||
if (
|
||||
!isLoading &&
|
||||
meeting?.error &&
|
||||
"status" in meeting.error &&
|
||||
meeting.error.status === 404
|
||||
) {
|
||||
notFound();
|
||||
}
|
||||
}, [isLoading, meeting?.error]);
|
||||
|
||||
useEffect(() => {
|
||||
if (isLoading || !isAuthenticated || !roomUrl) return;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user