Browse Source

Clear raise hand status on confidence leave

master
Bettenbuk Zoltan 6 years ago
parent
commit
b1a70240fc
1 changed files with 12 additions and 6 deletions
  1. 12
    6
      react/features/base/participants/middleware.js

+ 12
- 6
react/features/base/participants/middleware.js View File

210
                         break;
210
                         break;
211
                     case 'raisedHand': {
211
                     case 'raisedHand': {
212
                         _raiseHandUpdated(
212
                         _raiseHandUpdated(
213
-                            store, conference, participant, newValue);
213
+                            store, conference, participant.getId(), newValue);
214
                         break;
214
                         break;
215
                     }
215
                     }
216
                     default:
216
                     default:
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
  *
364
  *
361
  * @param {Function} dispatch - The Redux dispatch function.
365
  * @param {Function} dispatch - The Redux dispatch function.
362
  * @param {Object} conference - The conference for which we got an update.
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
  * @returns {void}
370
  * @returns {void}
366
  */
371
  */
367
-function _raiseHandUpdated({ dispatch, getState }, conference, participant, newValue) {
372
+function _raiseHandUpdated({ dispatch, getState }, conference, participantId, newValue) {
368
     const raisedHand = newValue === 'true';
373
     const raisedHand = newValue === 'true';
374
+    const pid = participantId || getLocalParticipant(getState()).id;
369
 
375
 
370
     dispatch(participantUpdated({
376
     dispatch(participantUpdated({
371
         conference,
377
         conference,
372
-        id: participant.getId(),
378
+        id: pid,
373
         raisedHand
379
         raisedHand
374
     }));
380
     }));
375
 
381
 
376
     if (raisedHand) {
382
     if (raisedHand) {
377
         dispatch(showNotification({
383
         dispatch(showNotification({
378
             titleArguments: {
384
             titleArguments: {
379
-                name: getParticipantDisplayName(getState, participant.getId())
385
+                name: getParticipantDisplayName(getState, pid)
380
             },
386
             },
381
             titleKey: 'notify.raisedHand'
387
             titleKey: 'notify.raisedHand'
382
         }, NOTIFICATION_TIMEOUT));
388
         }, NOTIFICATION_TIMEOUT));

Loading…
Cancel
Save