Skip to content

Commit

Permalink
View Recordings button only appears if the room has recordings (#5968)
Browse files Browse the repository at this point in the history
  • Loading branch information
alihadimazeh authored Nov 28, 2024
1 parent 391fd46 commit a5da808
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion app/javascript/components/rooms/room/join/JoinCard.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand All @@ -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');
Expand Down Expand Up @@ -222,7 +224,7 @@ export default function JoinCard() {
<h1 className="mt-2">
{publicRoom?.data.name}
</h1>
{ (recordValue !== 'false') && (
{ (recordValue !== 'false') && recordings?.data?.length > 0 && (
<ButtonLink
variant="brand-outline"
className="mt-3 mb-0 cursor-pointer"
Expand Down

0 comments on commit a5da808

Please sign in to comment.