fix: use SDK DailyFatalErrorType, add meeting-full/not-allowed/exp-token cases, remove dead end_date fallback

This commit is contained in:
Igor Loskutov
2026-02-05 19:43:25 -05:00
parent 4fd88b2fc1
commit d3161730ef
2 changed files with 38 additions and 10 deletions

View File

@@ -17,6 +17,7 @@ import DailyIframe, {
DailyCustomTrayButtons,
DailyEventObjectCustomButtonClick,
DailyEventObjectFatalError,
DailyFatalErrorType,
DailyFactoryOptions,
DailyParticipantsObject,
} from "@daily-co/daily-js";
@@ -97,6 +98,41 @@ function FatalErrorScreen({
</VStack>
</Center>
);
case "meeting-full":
return (
<Center width="100vw" height="100vh">
<VStack gap={4}>
<Text color="red.500">This meeting is full.</Text>
<Button onClick={() => router.push(`/${roomName}`)}>
Back to Room
</Button>
</VStack>
</Center>
);
case "not-allowed":
return (
<Center width="100vw" height="100vh">
<VStack gap={4}>
<Text color="red.500">
You are not allowed to join this meeting.
</Text>
<Button onClick={() => router.push(`/${roomName}`)}>
Back to Room
</Button>
</VStack>
</Center>
);
case "exp-token":
return (
<Center width="100vw" height="100vh">
<VStack gap={4}>
<Text color="red.500">Your session has expired.</Text>
<Button onClick={() => window.location.reload()}>
Try Rejoining
</Button>
</VStack>
</Center>
);
default:
return (
<Center width="100vw" height="100vh">
@@ -148,12 +184,7 @@ const USE_FRAME_INIT_STATE = {
joined: false as boolean,
} as const;
type DailyFatalErrorType =
| "connection-error"
| "exp-room"
| "ejected"
| (string & {});
type FatalError = { type: DailyFatalErrorType; message: string };
type FatalError = { type: DailyFatalErrorType | "unknown"; message: string };
// Daily js and not Daily react used right now because daily-js allows for prebuild interface vs. -react is customizable but has no nice defaults
const useFrame = (