prevent moderator eject errors

This commit is contained in:
Ramón Souza 2024-04-11 11:14:07 -03:00
parent 8e5c23c473
commit 64a45f7613

View File

@ -44,7 +44,7 @@ export const generateActionsPermissions = (
&& subjectUserVoice?.joined && subjectUserVoice?.joined
&& !subjectUserVoice.listenOnly && !subjectUserVoice.listenOnly
&& subjectUserVoice.muted && subjectUserVoice.muted
&& (amISubjectUser || usersPolicies.allowModsToUnmuteUsers); && (amISubjectUser || usersPolicies?.allowModsToUnmuteUsers);
const allowedToResetStatus = hasAuthority const allowedToResetStatus = hasAuthority
&& subjectUser.emoji !== EMOJI_STATUSES.none && subjectUser.emoji !== EMOJI_STATUSES.none
@ -60,14 +60,14 @@ export const generateActionsPermissions = (
&& !isSubjectUserModerator && !isSubjectUserModerator
&& !isDialInUser && !isDialInUser
&& !isBreakout && !isBreakout
&& !(isSubjectUserGuest && usersPolicies.authenticatedGuest); && !(isSubjectUserGuest && usersPolicies?.authenticatedGuest);
const allowedToDemote = amIModerator const allowedToDemote = amIModerator
&& !amISubjectUser && !amISubjectUser
&& isSubjectUserModerator && isSubjectUserModerator
&& !isDialInUser && !isDialInUser
&& !isBreakout && !isBreakout
&& !(isSubjectUserGuest && usersPolicies.authenticatedGuest); && !(isSubjectUserGuest && usersPolicies?.authenticatedGuest);
const allowedToChangeStatus = amISubjectUser && USER_STATUS_ENABLED; const allowedToChangeStatus = amISubjectUser && USER_STATUS_ENABLED;
@ -80,7 +80,7 @@ export const generateActionsPermissions = (
const allowedToEjectCameras = amIModerator const allowedToEjectCameras = amIModerator
&& !amISubjectUser && !amISubjectUser
&& usersPolicies.allowModsToEjectCameras; && usersPolicies?.allowModsToEjectCameras;
const allowedToSetPresenter = amIModerator const allowedToSetPresenter = amIModerator
&& !subjectUser.presenter && !subjectUser.presenter