From 10628bbd1d534948966cb86c400105d65d9aebf1 Mon Sep 17 00:00:00 2001 From: Ali Hadi Mazeh Date: Thu, 28 Nov 2024 11:02:03 -0500 Subject: [PATCH] View Recordings button only appears if the room has recordings --- app/javascript/components/rooms/room/join/JoinCard.jsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/javascript/components/rooms/room/join/JoinCard.jsx b/app/javascript/components/rooms/room/join/JoinCard.jsx index 6c4034eade..c89f1b7550 100644 --- a/app/javascript/components/rooms/room/join/JoinCard.jsx +++ b/app/javascript/components/rooms/room/join/JoinCard.jsx @@ -43,6 +43,7 @@ import useRoomJoinForm from '../../../../hooks/forms/rooms/useRoomJoinForm'; import ButtonLink from '../../../shared_components/utilities/ButtonLink'; import Title from '../../../shared_components/utilities/Title'; import useRoomConfigValue from '../../../../hooks/queries/rooms/useRoomConfigValue'; +import usePublicRecordings from '../../../../hooks/queries/recordings/usePublicRecordings'; export default function JoinCard() { const { t } = useTranslation(); @@ -53,6 +54,7 @@ export default function JoinCard() { const publicRoom = usePublicRoom(friendlyId); const roomStatusAPI = useRoomStatus(friendlyId, joinInterval); + const { data: recordings } = usePublicRecordings({ friendlyId }); const { data: env } = useEnv(); const { data: recordValue } = useRoomConfigValue('record'); @@ -222,7 +224,7 @@ export default function JoinCard() {

{publicRoom?.data.name}

- { (recordValue !== 'false') && ( + { (recordValue !== 'false') && recordings?.data?.length > 0 && (