fix: Fixes showing awaiting AV moderation after grant moderator.
This commit is contained in:
parent
59ef5c4789
commit
fc59cdbdbe
|
@ -5,8 +5,11 @@ import { getConferenceState } from '../base/conference';
|
|||
import { JitsiConferenceEvents } from '../base/lib-jitsi-meet';
|
||||
import { MEDIA_TYPE } from '../base/media';
|
||||
import {
|
||||
getLocalParticipant,
|
||||
getParticipantDisplayName,
|
||||
getRemoteParticipants,
|
||||
isLocalParticipantModerator,
|
||||
isParticipantModerator,
|
||||
PARTICIPANT_UPDATED,
|
||||
raiseHand
|
||||
} from '../base/participants';
|
||||
|
@ -124,11 +127,12 @@ MiddlewareRegistry.register(({ dispatch, getState }) => next => action => {
|
|||
case PARTICIPANT_UPDATED: {
|
||||
const state = getState();
|
||||
const audioModerationEnabled = isEnabledFromState(MEDIA_TYPE.AUDIO, state);
|
||||
|
||||
// this is handled only by moderators
|
||||
if (audioModerationEnabled && isLocalParticipantModerator(state)) {
|
||||
const participant = action.participant;
|
||||
|
||||
if (participant && audioModerationEnabled) {
|
||||
if (isLocalParticipantModerator(state)) {
|
||||
|
||||
// this is handled only by moderators
|
||||
if (participant.raisedHand) {
|
||||
// if participant raises hand show notification
|
||||
!isParticipantApproved(participant.id, MEDIA_TYPE.AUDIO)(state)
|
||||
|
@ -138,6 +142,15 @@ MiddlewareRegistry.register(({ dispatch, getState }) => next => action => {
|
|||
isParticipantPending(participant, MEDIA_TYPE.AUDIO)(state)
|
||||
&& dispatch(dismissPendingAudioParticipant(participant));
|
||||
}
|
||||
} else if (participant.id === getLocalParticipant(state).id
|
||||
&& /* the new role */ isParticipantModerator(participant)) {
|
||||
|
||||
// this is the granted moderator case
|
||||
getRemoteParticipants(state).forEach(p => {
|
||||
p.raisedHand && !isParticipantApproved(p.id, MEDIA_TYPE.AUDIO)(state)
|
||||
&& dispatch(participantPendingAudio(p));
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
break;
|
||||
|
|
Loading…
Reference in New Issue