Skip to content

Commit

Permalink
fix: page crash for options in hand raise accordion
Browse files Browse the repository at this point in the history
  • Loading branch information
raviteja83 committed Feb 27, 2024
1 parent 3d4fc8b commit ae8d535
Showing 1 changed file with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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 ? (
<Dropdown.Item css={dropdownItemCSS} onClick={() => setTrackEnabled('audio', false)}>
Expand All @@ -72,14 +76,14 @@ const MuteUnmuteOption = ({ roleName, peerList }: { peerList: HMSPeer[]; roleNam
<Dropdown.Item css={dropdownItemCSS} onClick={() => setTrackEnabled('audio', true)}>
<MicOnIcon />
<Text variant="sm" css={optionTextCSS}>
Unmute Audio for All
Request Unmute Audio for All
</Text>
</Dropdown.Item>
) : null}
</>
)}

{role.publishParams.allowed?.includes('audio') && (
{role.publishParams.allowed.includes('video') && (
<>
{allPeersHaveVideoOn && permissions?.mute ? (
<Dropdown.Item css={dropdownItemCSS} onClick={() => setTrackEnabled('video', false)}>
Expand All @@ -94,7 +98,7 @@ const MuteUnmuteOption = ({ roleName, peerList }: { peerList: HMSPeer[]; roleNam
<Dropdown.Item css={dropdownItemCSS} onClick={() => setTrackEnabled('video', true)}>
<VideoOnIcon />
<Text variant="sm" css={optionTextCSS}>
Unmute Video for All
Request Unmute Video for All
</Text>
</Dropdown.Item>
) : null}
Expand Down

0 comments on commit ae8d535

Please sign in to comment.