fix create breakouts option in userlist dropdown

This commit is contained in:
Ramón Souza 2024-06-05 11:34:26 -03:00
parent 6e3b582bdd
commit 48ba1d5875

View File

@ -303,7 +303,7 @@ const UserTitleOptions: React.FC<UserTitleOptionsProps> = ({
{ {
key: 'separator-02', key: 'separator-02',
isSeparator: true, isSeparator: true,
allow: true, allow: canCreateBreakout,
}, },
{ {
allow: isLearningDashboardEnabled(), allow: isLearningDashboardEnabled(),
@ -381,7 +381,7 @@ const UserTitleOptionsContainer: React.FC = () => {
const { data: meetingInfo } = useMeeting((meeting: Partial<Meeting>) => ({ const { data: meetingInfo } = useMeeting((meeting: Partial<Meeting>) => ({
voiceSettings: meeting?.voiceSettings, voiceSettings: meeting?.voiceSettings,
isBreakout: meeting?.isBreakout, isBreakout: meeting?.isBreakout,
breakoutPolicies: meeting?.breakoutPolicies, componentsFlags: meeting?.componentsFlags,
name: meeting?.name, name: meeting?.name,
})); }));
@ -392,14 +392,15 @@ const UserTitleOptionsContainer: React.FC = () => {
// in case of current user isn't load yet // in case of current user isn't load yet
if (!currentUser?.isModerator ?? true) return null; if (!currentUser?.isModerator ?? true) return null;
const hasBreakoutRooms = meetingInfo?.componentsFlags?.hasBreakoutRoom ?? false;
return ( return (
<UserTitleOptions <UserTitleOptions
isRTL={isRTL} isRTL={isRTL}
isMeetingMuted={meetingInfo?.voiceSettings?.muteOnStart} isMeetingMuted={meetingInfo?.voiceSettings?.muteOnStart}
isBreakout={meetingInfo?.isBreakout} isBreakout={meetingInfo?.isBreakout}
isModerator={currentUser?.isModerator ?? false} isModerator={currentUser?.isModerator ?? false}
hasBreakoutRooms={meetingInfo?.breakoutPolicies?.breakoutRooms !== undefined hasBreakoutRooms={hasBreakoutRooms}
&& meetingInfo.breakoutPolicies.breakoutRooms.length > 0}
meetingName={meetingInfo?.name} meetingName={meetingInfo?.name}
/> />
); );