mirror of
https://github.com/Monadical-SAS/reflector.git
synced 2026-02-06 18:56:48 +00:00
fix: use SDK DailyFatalErrorType, add meeting-full/not-allowed/exp-token cases, remove dead end_date fallback
This commit is contained in:
@@ -83,9 +83,6 @@ def _should_sync(room) -> bool:
|
|||||||
return time_since_sync.total_seconds() >= room.ics_fetch_interval
|
return time_since_sync.total_seconds() >= room.ics_fetch_interval
|
||||||
|
|
||||||
|
|
||||||
MEETING_DEFAULT_DURATION = timedelta(hours=1)
|
|
||||||
|
|
||||||
|
|
||||||
async def create_upcoming_meetings_for_event(
|
async def create_upcoming_meetings_for_event(
|
||||||
event: CalendarEvent, create_window: datetime, room: Room
|
event: CalendarEvent, create_window: datetime, room: Room
|
||||||
):
|
):
|
||||||
@@ -98,7 +95,7 @@ async def create_upcoming_meetings_for_event(
|
|||||||
|
|
||||||
# Prevent duplicate meetings from aggregated calendar feeds
|
# Prevent duplicate meetings from aggregated calendar feeds
|
||||||
# (e.g. same event appears with different UIDs from Cal.com and Google Calendar)
|
# (e.g. same event appears with different UIDs from Cal.com and Google Calendar)
|
||||||
end_date = event.end_time or (event.start_time + MEETING_DEFAULT_DURATION)
|
end_date = event.end_time
|
||||||
existing_by_time = await meetings_controller.get_by_room_and_time_window(
|
existing_by_time = await meetings_controller.get_by_room_and_time_window(
|
||||||
room, event.start_time, end_date
|
room, event.start_time, end_date
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -17,6 +17,7 @@ import DailyIframe, {
|
|||||||
DailyCustomTrayButtons,
|
DailyCustomTrayButtons,
|
||||||
DailyEventObjectCustomButtonClick,
|
DailyEventObjectCustomButtonClick,
|
||||||
DailyEventObjectFatalError,
|
DailyEventObjectFatalError,
|
||||||
|
DailyFatalErrorType,
|
||||||
DailyFactoryOptions,
|
DailyFactoryOptions,
|
||||||
DailyParticipantsObject,
|
DailyParticipantsObject,
|
||||||
} from "@daily-co/daily-js";
|
} from "@daily-co/daily-js";
|
||||||
@@ -97,6 +98,41 @@ function FatalErrorScreen({
|
|||||||
</VStack>
|
</VStack>
|
||||||
</Center>
|
</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:
|
default:
|
||||||
return (
|
return (
|
||||||
<Center width="100vw" height="100vh">
|
<Center width="100vw" height="100vh">
|
||||||
@@ -148,12 +184,7 @@ const USE_FRAME_INIT_STATE = {
|
|||||||
joined: false as boolean,
|
joined: false as boolean,
|
||||||
} as const;
|
} as const;
|
||||||
|
|
||||||
type DailyFatalErrorType =
|
type FatalError = { type: DailyFatalErrorType | "unknown"; message: string };
|
||||||
| "connection-error"
|
|
||||||
| "exp-room"
|
|
||||||
| "ejected"
|
|
||||||
| (string & {});
|
|
||||||
type FatalError = { type: DailyFatalErrorType; 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
|
// 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 = (
|
const useFrame = (
|
||||||
|
|||||||
Reference in New Issue
Block a user