From 6f443686477d38b446135516c0cf9daf17d70c32 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=94=D0=B0=D0=BC=D1=8F=D0=BD=20=D0=9C=D0=B8=D0=BD=D0=BA?= =?UTF-8?q?=D0=BE=D0=B2?= Date: Fri, 6 Aug 2021 14:36:08 -0500 Subject: [PATCH] fix(av-moderation): Fixes approving and dismissing the notification. When participants panel is open and we approve a participant to unmute, the notification was not hidden as we were not correctly updating the state. We were expecting a participant object, but an id of the participant was used. --- package-lock.json | 4 ++-- package.json | 2 +- react/features/av-moderation/actions.js | 8 ++++---- react/features/av-moderation/reducer.js | 8 ++++---- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/package-lock.json b/package-lock.json index 7ed3ab19d..9b33e6165 100644 --- a/package-lock.json +++ b/package-lock.json @@ -11087,8 +11087,8 @@ } }, "lib-jitsi-meet": { - "version": "github:jitsi/lib-jitsi-meet#6a3df11ffa7a2204b579326e23cdaa85a79521d1", - "from": "github:jitsi/lib-jitsi-meet#6a3df11ffa7a2204b579326e23cdaa85a79521d1", + "version": "github:jitsi/lib-jitsi-meet#40fd6bdeaa5014930373c28c7a2c50c00281f126", + "from": "github:jitsi/lib-jitsi-meet#40fd6bdeaa5014930373c28c7a2c50c00281f126", "requires": { "@jitsi/js-utils": "1.0.2", "@jitsi/sdp-interop": "github:jitsi/sdp-interop#5fc4af6dcf8a6e6af9fedbcd654412fd47b1b4ae", diff --git a/package.json b/package.json index 9c22b1688..5225ee71d 100644 --- a/package.json +++ b/package.json @@ -56,7 +56,7 @@ "jquery-i18next": "1.2.1", "js-md5": "0.6.1", "jwt-decode": "2.2.0", - "lib-jitsi-meet": "github:jitsi/lib-jitsi-meet#6a3df11ffa7a2204b579326e23cdaa85a79521d1", + "lib-jitsi-meet": "github:jitsi/lib-jitsi-meet#40fd6bdeaa5014930373c28c7a2c50c00281f126", "libflacjs": "github:mmig/libflac.js#93d37e7f811f01cf7d8b6a603e38bd3c3810907d", "lodash": "4.17.21", "moment": "2.29.1", diff --git a/react/features/av-moderation/actions.js b/react/features/av-moderation/actions.js index 2c9b6e6f9..df22dc9ce 100644 --- a/react/features/av-moderation/actions.js +++ b/react/features/av-moderation/actions.js @@ -53,20 +53,20 @@ export const disableModeration = (mediaType: MediaType, actor: Object) => { * @returns {Object} */ export function dismissPendingAudioParticipant(participant: Object) { - return dismissPendingParticipant(participant, MEDIA_TYPE.AUDIO); + return dismissPendingParticipant(participant.id, MEDIA_TYPE.AUDIO); } /** * Hides the notification with the participant that asked to unmute. * - * @param {Object} participant - The participant for which the notification to be hidden. + * @param {string} id - The participant id for which the notification to be hidden. * @param {MediaType} mediaType - The media type. * @returns {Object} */ -export function dismissPendingParticipant(participant: Object, mediaType: MediaType) { +export function dismissPendingParticipant(id: string, mediaType: MediaType) { return { type: DISMISS_PENDING_PARTICIPANT, - participant, + id, mediaType }; } diff --git a/react/features/av-moderation/reducer.js b/react/features/av-moderation/reducer.js index e5b501ccc..cec82726c 100644 --- a/react/features/av-moderation/reducer.js +++ b/react/features/av-moderation/reducer.js @@ -135,7 +135,7 @@ ReducerRegistry.register('features/av-moderation', (state = initialState, action } if (videoModerationEnabled) { - hasStateChanged = _updatePendingParticipant(MEDIA_TYPE.VIDEO, participant, state); + hasStateChanged = hasStateChanged || _updatePendingParticipant(MEDIA_TYPE.VIDEO, participant, state); } // If the state has changed we need to return a new object reference in order to trigger subscriber updates. @@ -183,19 +183,19 @@ ReducerRegistry.register('features/av-moderation', (state = initialState, action } case DISMISS_PENDING_PARTICIPANT: { - const { participant, mediaType } = action; + const { id, mediaType } = action; if (mediaType === MEDIA_TYPE.AUDIO) { return { ...state, - pendingAudio: state.pendingAudio.filter(pending => pending.id !== participant.id) + pendingAudio: state.pendingAudio.filter(pending => pending.id !== id) }; } if (mediaType === MEDIA_TYPE.VIDEO) { return { ...state, - pendingVideo: state.pendingVideo.filter(pending => pending.id !== participant.id) + pendingVideo: state.pendingVideo.filter(pending => pending.id !== id) }; }