From ae8d535d60e796751ec0e61ff44be394f9c662a6 Mon Sep 17 00:00:00 2001 From: raviteja83 Date: Tue, 27 Feb 2024 16:52:05 +0530 Subject: [PATCH] fix: page crash for options in hand raise accordion --- .../src/Prebuilt/components/Footer/RoleOptions.tsx | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/packages/roomkit-react/src/Prebuilt/components/Footer/RoleOptions.tsx b/packages/roomkit-react/src/Prebuilt/components/Footer/RoleOptions.tsx index 3234fb4e45..0e5cb906f3 100644 --- a/packages/roomkit-react/src/Prebuilt/components/Footer/RoleOptions.tsx +++ b/packages/roomkit-react/src/Prebuilt/components/Footer/RoleOptions.tsx @@ -55,9 +55,13 @@ const MuteUnmuteOption = ({ roleName, peerList }: { peerList: HMSPeer[]; roleNam } }; + if (!role) { + return null; + } + return ( <> - {role.publishParams.allowed?.includes('audio') && ( + {role.publishParams.allowed.includes('audio') && ( <> {allPeersHaveAudioOn && permissions?.mute ? ( setTrackEnabled('audio', false)}> @@ -72,14 +76,14 @@ const MuteUnmuteOption = ({ roleName, peerList }: { peerList: HMSPeer[]; roleNam setTrackEnabled('audio', true)}> - Unmute Audio for All + Request Unmute Audio for All ) : null} )} - {role.publishParams.allowed?.includes('audio') && ( + {role.publishParams.allowed.includes('video') && ( <> {allPeersHaveVideoOn && permissions?.mute ? ( setTrackEnabled('video', false)}> @@ -94,7 +98,7 @@ const MuteUnmuteOption = ({ roleName, peerList }: { peerList: HMSPeer[]; roleNam setTrackEnabled('video', true)}> - Unmute Video for All + Request Unmute Video for All ) : null}