Ver código fonte

Clear raise hand status on confidence leave

master
Bettenbuk Zoltan 6 anos atrás
pai
commit
b1a70240fc
1 arquivos alterados com 12 adições e 6 exclusões
  1. 12
    6
      react/features/base/participants/middleware.js

+ 12
- 6
react/features/base/participants/middleware.js Ver arquivo

@@ -210,7 +210,7 @@ StateListenerRegistry.register(
210 210
                         break;
211 211
                     case 'raisedHand': {
212 212
                         _raiseHandUpdated(
213
-                            store, conference, participant, newValue);
213
+                            store, conference, participant.getId(), newValue);
214 214
                         break;
215 215
                     }
216 216
                     default:
@@ -219,6 +219,10 @@ StateListenerRegistry.register(
219 219
                     }
220 220
 
221 221
                 });
222
+        } else {
223
+            // We left the conference, raise hand of the local participant must be updated.
224
+            _raiseHandUpdated(
225
+                store, conference, undefined, false);
222 226
         }
223 227
     }
224 228
 );
@@ -360,23 +364,25 @@ function _participantJoinedOrUpdated({ getState }, next, action) {
360 364
  *
361 365
  * @param {Function} dispatch - The Redux dispatch function.
362 366
  * @param {Object} conference - The conference for which we got an update.
363
- * @param {*} participant - The participant from which we got an update.
364
- * @param {*} newValue - The new value of the raise hand status.
367
+ * @param {string?} participantId - The ID of the participant from which we got an update. If undefined,
368
+ * we update the local participant.
369
+ * @param {boolean} newValue - The new value of the raise hand status.
365 370
  * @returns {void}
366 371
  */
367
-function _raiseHandUpdated({ dispatch, getState }, conference, participant, newValue) {
372
+function _raiseHandUpdated({ dispatch, getState }, conference, participantId, newValue) {
368 373
     const raisedHand = newValue === 'true';
374
+    const pid = participantId || getLocalParticipant(getState()).id;
369 375
 
370 376
     dispatch(participantUpdated({
371 377
         conference,
372
-        id: participant.getId(),
378
+        id: pid,
373 379
         raisedHand
374 380
     }));
375 381
 
376 382
     if (raisedHand) {
377 383
         dispatch(showNotification({
378 384
             titleArguments: {
379
-                name: getParticipantDisplayName(getState, participant.getId())
385
+                name: getParticipantDisplayName(getState, pid)
380 386
             },
381 387
             titleKey: 'notify.raisedHand'
382 388
         }, NOTIFICATION_TIMEOUT));

Carregando…
Cancelar
Salvar