Selaa lähdekoodia

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.
master
Дамян Минков 3 vuotta sitten
vanhempi
commit
6f44368647

+ 2
- 2
package-lock.json Näytä tiedosto

@@ -11087,8 +11087,8 @@
11087 11087
       }
11088 11088
     },
11089 11089
     "lib-jitsi-meet": {
11090
-      "version": "github:jitsi/lib-jitsi-meet#6a3df11ffa7a2204b579326e23cdaa85a79521d1",
11091
-      "from": "github:jitsi/lib-jitsi-meet#6a3df11ffa7a2204b579326e23cdaa85a79521d1",
11090
+      "version": "github:jitsi/lib-jitsi-meet#40fd6bdeaa5014930373c28c7a2c50c00281f126",
11091
+      "from": "github:jitsi/lib-jitsi-meet#40fd6bdeaa5014930373c28c7a2c50c00281f126",
11092 11092
       "requires": {
11093 11093
         "@jitsi/js-utils": "1.0.2",
11094 11094
         "@jitsi/sdp-interop": "github:jitsi/sdp-interop#5fc4af6dcf8a6e6af9fedbcd654412fd47b1b4ae",

+ 1
- 1
package.json Näytä tiedosto

@@ -56,7 +56,7 @@
56 56
     "jquery-i18next": "1.2.1",
57 57
     "js-md5": "0.6.1",
58 58
     "jwt-decode": "2.2.0",
59
-    "lib-jitsi-meet": "github:jitsi/lib-jitsi-meet#6a3df11ffa7a2204b579326e23cdaa85a79521d1",
59
+    "lib-jitsi-meet": "github:jitsi/lib-jitsi-meet#40fd6bdeaa5014930373c28c7a2c50c00281f126",
60 60
     "libflacjs": "github:mmig/libflac.js#93d37e7f811f01cf7d8b6a603e38bd3c3810907d",
61 61
     "lodash": "4.17.21",
62 62
     "moment": "2.29.1",

+ 4
- 4
react/features/av-moderation/actions.js Näytä tiedosto

@@ -53,20 +53,20 @@ export const disableModeration = (mediaType: MediaType, actor: Object) => {
53 53
  * @returns {Object}
54 54
  */
55 55
 export function dismissPendingAudioParticipant(participant: Object) {
56
-    return dismissPendingParticipant(participant, MEDIA_TYPE.AUDIO);
56
+    return dismissPendingParticipant(participant.id, MEDIA_TYPE.AUDIO);
57 57
 }
58 58
 
59 59
 /**
60 60
  * Hides the notification with the participant that asked to unmute.
61 61
  *
62
- * @param {Object} participant - The participant for which the notification to be hidden.
62
+ * @param {string} id - The participant id for which the notification to be hidden.
63 63
  * @param {MediaType} mediaType - The media type.
64 64
  * @returns {Object}
65 65
  */
66
-export function dismissPendingParticipant(participant: Object, mediaType: MediaType) {
66
+export function dismissPendingParticipant(id: string, mediaType: MediaType) {
67 67
     return {
68 68
         type: DISMISS_PENDING_PARTICIPANT,
69
-        participant,
69
+        id,
70 70
         mediaType
71 71
     };
72 72
 }

+ 4
- 4
react/features/av-moderation/reducer.js Näytä tiedosto

@@ -135,7 +135,7 @@ ReducerRegistry.register('features/av-moderation', (state = initialState, action
135 135
         }
136 136
 
137 137
         if (videoModerationEnabled) {
138
-            hasStateChanged = _updatePendingParticipant(MEDIA_TYPE.VIDEO, participant, state);
138
+            hasStateChanged = hasStateChanged || _updatePendingParticipant(MEDIA_TYPE.VIDEO, participant, state);
139 139
         }
140 140
 
141 141
         // 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
183 183
     }
184 184
 
185 185
     case DISMISS_PENDING_PARTICIPANT: {
186
-        const { participant, mediaType } = action;
186
+        const { id, mediaType } = action;
187 187
 
188 188
         if (mediaType === MEDIA_TYPE.AUDIO) {
189 189
             return {
190 190
                 ...state,
191
-                pendingAudio: state.pendingAudio.filter(pending => pending.id !== participant.id)
191
+                pendingAudio: state.pendingAudio.filter(pending => pending.id !== id)
192 192
             };
193 193
         }
194 194
 
195 195
         if (mediaType === MEDIA_TYPE.VIDEO) {
196 196
             return {
197 197
                 ...state,
198
-                pendingVideo: state.pendingVideo.filter(pending => pending.id !== participant.id)
198
+                pendingVideo: state.pendingVideo.filter(pending => pending.id !== id)
199 199
             };
200 200
         }
201 201
 

Loading…
Peruuta
Tallenna