mirror of
https://github.com/Monadical-SAS/reflector.git
synced 2025-12-20 20:29:06 +00:00
only recordings that are *recorded* require consent
This commit is contained in:
@@ -9,6 +9,7 @@ import { notFound } from "next/navigation";
|
||||
import useSessionStatus from "../lib/useSessionStatus";
|
||||
import { useRecordingConsent } from "../recordingConsentContext";
|
||||
import useApi from "../lib/useApi";
|
||||
import { Meeting } from '../api';
|
||||
|
||||
export type RoomDetails = {
|
||||
params: {
|
||||
@@ -96,6 +97,10 @@ function ConsentDialog({ meetingId }: { meetingId: string }) {
|
||||
return <></>
|
||||
}
|
||||
|
||||
const recordingTypeRequiresConsent = (recordingType: NonNullable<Meeting['recording_type']>) => {
|
||||
return recordingType === 'cloud';
|
||||
}
|
||||
|
||||
export default function Room(details: RoomDetails) {
|
||||
const wherebyRef = useRef<HTMLElement>(null);
|
||||
const roomName = details.params.roomName;
|
||||
@@ -109,6 +114,8 @@ export default function Room(details: RoomDetails) {
|
||||
|
||||
const meetingId = meeting?.response?.id;
|
||||
|
||||
const recordingType = meeting?.response?.recording_type;
|
||||
|
||||
const handleLeave = useCallback(() => {
|
||||
router.push("/browse");
|
||||
}, [router]);
|
||||
@@ -165,7 +172,7 @@ export default function Room(details: RoomDetails) {
|
||||
room={roomUrl}
|
||||
style={{ width: "100vw", height: "100vh" }}
|
||||
/>
|
||||
<ConsentDialog meetingId={meetingId} />
|
||||
{recordingType && recordingTypeRequiresConsent(recordingType) && <ConsentDialog meetingId={meetingId} />}
|
||||
</>
|
||||
)}
|
||||
</>
|
||||
|
||||
@@ -546,6 +546,12 @@ export const $Meeting = {
|
||||
format: "date-time",
|
||||
title: "End Date",
|
||||
},
|
||||
recording_type: {
|
||||
type: "string",
|
||||
enum: ["none", "local", "cloud"],
|
||||
title: "Recording Type",
|
||||
default: "cloud",
|
||||
},
|
||||
},
|
||||
type: "object",
|
||||
required: [
|
||||
|
||||
@@ -108,8 +108,11 @@ export type Meeting = {
|
||||
host_room_url: string;
|
||||
start_date: string;
|
||||
end_date: string;
|
||||
recording_type?: "none" | "local" | "cloud";
|
||||
};
|
||||
|
||||
export type recording_type = "none" | "local" | "cloud";
|
||||
|
||||
export type MeetingConsentRequest = {
|
||||
consent_given: boolean;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user