From 15c95d6bfa217f83131d77f8ba2236e79214798d Mon Sep 17 00:00:00 2001 From: Sergey Mankovsky Date: Thu, 5 Sep 2024 14:01:03 +0200 Subject: [PATCH 1/2] Remove new meeting button --- www/app/(app)/browse/page.tsx | 4 ---- 1 file changed, 4 deletions(-) diff --git a/www/app/(app)/browse/page.tsx b/www/app/(app)/browse/page.tsx index 52e80454..454ff6ba 100644 --- a/www/app/(app)/browse/page.tsx +++ b/www/app/(app)/browse/page.tsx @@ -151,10 +151,6 @@ export default function TranscriptBrowser() { total={response?.total || 0} size={response?.size || 0} /> - - Date: Thu, 5 Sep 2024 15:04:49 +0200 Subject: [PATCH 2/2] Opt out of recording --- www/app/[roomName]/page.tsx | 61 ++++++++++++++++++++++++++++++++++--- 1 file changed, 57 insertions(+), 4 deletions(-) diff --git a/www/app/[roomName]/page.tsx b/www/app/[roomName]/page.tsx index c2b18f50..9d81f4ef 100644 --- a/www/app/[roomName]/page.tsx +++ b/www/app/[roomName]/page.tsx @@ -1,7 +1,8 @@ "use client"; import "@whereby.com/browser-sdk/embed"; -import { useCallback, useEffect, useRef } from "react"; +import { useCallback, useEffect, useRef, useState } from "react"; +import { Box, Button, Text, VStack, HStack } from "@chakra-ui/react"; import useRoomMeeting from "./useRoomMeeting"; import { useRouter } from "next/navigation"; import { useSession } from "next-auth/react"; @@ -21,13 +22,19 @@ export default function Room(details: RoomDetails) { const sessionReady = status !== "loading"; const isAuthenticated = status === "authenticated"; + const [consentGiven, setConsentGiven] = useState(null); + const roomUrl = meeting?.response?.host_room_url ? meeting?.response?.host_room_url : meeting?.response?.room_url; - const handleLeave = useCallback((e) => { + const handleLeave = useCallback(() => { router.push("/browse"); - }, []); + }, [router]); + + const handleConsent = (consent: boolean) => { + setConsentGiven(consent); + }; useEffect(() => { if (!sessionReady || !isAuthenticated || !roomUrl) return; @@ -37,7 +44,53 @@ export default function Room(details: RoomDetails) { return () => { wherebyRef.current?.removeEventListener("leave", handleLeave); }; - }, [handleLeave, roomUrl]); + }, [handleLeave, roomUrl, sessionReady, isAuthenticated]); + + if (!isAuthenticated && !consentGiven) { + return ( + + + {consentGiven === null ? ( + <> + + This meeting may be recorded. Do you consent to being recorded? + + + + + + + ) : ( + <> + + You cannot join the meeting without consenting to being + recorded. + + + )} + + + ); + } return ( <>