Ver código fonte

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 anos atrás
pai
commit
6f44368647

+ 2
- 2
package-lock.json Ver arquivo

11087
       }
11087
       }
11088
     },
11088
     },
11089
     "lib-jitsi-meet": {
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
       "requires": {
11092
       "requires": {
11093
         "@jitsi/js-utils": "1.0.2",
11093
         "@jitsi/js-utils": "1.0.2",
11094
         "@jitsi/sdp-interop": "github:jitsi/sdp-interop#5fc4af6dcf8a6e6af9fedbcd654412fd47b1b4ae",
11094
         "@jitsi/sdp-interop": "github:jitsi/sdp-interop#5fc4af6dcf8a6e6af9fedbcd654412fd47b1b4ae",

+ 1
- 1
package.json Ver arquivo

56
     "jquery-i18next": "1.2.1",
56
     "jquery-i18next": "1.2.1",
57
     "js-md5": "0.6.1",
57
     "js-md5": "0.6.1",
58
     "jwt-decode": "2.2.0",
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
     "libflacjs": "github:mmig/libflac.js#93d37e7f811f01cf7d8b6a603e38bd3c3810907d",
60
     "libflacjs": "github:mmig/libflac.js#93d37e7f811f01cf7d8b6a603e38bd3c3810907d",
61
     "lodash": "4.17.21",
61
     "lodash": "4.17.21",
62
     "moment": "2.29.1",
62
     "moment": "2.29.1",

+ 4
- 4
react/features/av-moderation/actions.js Ver arquivo

53
  * @returns {Object}
53
  * @returns {Object}
54
  */
54
  */
55
 export function dismissPendingAudioParticipant(participant: Object) {
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
  * Hides the notification with the participant that asked to unmute.
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
  * @param {MediaType} mediaType - The media type.
63
  * @param {MediaType} mediaType - The media type.
64
  * @returns {Object}
64
  * @returns {Object}
65
  */
65
  */
66
-export function dismissPendingParticipant(participant: Object, mediaType: MediaType) {
66
+export function dismissPendingParticipant(id: string, mediaType: MediaType) {
67
     return {
67
     return {
68
         type: DISMISS_PENDING_PARTICIPANT,
68
         type: DISMISS_PENDING_PARTICIPANT,
69
-        participant,
69
+        id,
70
         mediaType
70
         mediaType
71
     };
71
     };
72
 }
72
 }

+ 4
- 4
react/features/av-moderation/reducer.js Ver arquivo

135
         }
135
         }
136
 
136
 
137
         if (videoModerationEnabled) {
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
         // If the state has changed we need to return a new object reference in order to trigger subscriber updates.
141
         // If the state has changed we need to return a new object reference in order to trigger subscriber updates.
183
     }
183
     }
184
 
184
 
185
     case DISMISS_PENDING_PARTICIPANT: {
185
     case DISMISS_PENDING_PARTICIPANT: {
186
-        const { participant, mediaType } = action;
186
+        const { id, mediaType } = action;
187
 
187
 
188
         if (mediaType === MEDIA_TYPE.AUDIO) {
188
         if (mediaType === MEDIA_TYPE.AUDIO) {
189
             return {
189
             return {
190
                 ...state,
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
         if (mediaType === MEDIA_TYPE.VIDEO) {
195
         if (mediaType === MEDIA_TYPE.VIDEO) {
196
             return {
196
             return {
197
                 ...state,
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
 

Carregando…
Cancelar
Salvar