feat(raised-hand) Change raisedHand to a timestamp instead of boole… (#10167)

- this was needed for sorting the raised hand participants in participants pane in
the order they raised their hand also for participants joining late
This commit is contained in:
Horatiu Muresan
2021-10-21 12:40:57 +03:00
committed by GitHub
parent f435fc4ade
commit 4b7a6741fa
17 changed files with 97 additions and 78 deletions

View File

@@ -8,6 +8,7 @@ import { MEDIA_TYPE } from '../base/media';
import {
getLocalParticipant,
getRemoteParticipants,
hasRaisedHand,
isLocalParticipantModerator,
isParticipantModerator,
PARTICIPANT_UPDATED,
@@ -134,7 +135,7 @@ MiddlewareRegistry.register(({ dispatch, getState }) => next => action => {
if (isLocalParticipantModerator(state)) {
// this is handled only by moderators
if (participant.raisedHand) {
if (hasRaisedHand(participant)) {
// if participant raises hand show notification
!isParticipantApproved(participant.id, MEDIA_TYPE.AUDIO)(state)
&& dispatch(participantPendingAudio(participant));
@@ -148,7 +149,7 @@ MiddlewareRegistry.register(({ dispatch, getState }) => next => action => {
// this is the granted moderator case
getRemoteParticipants(state).forEach(p => {
p.raisedHand && !isParticipantApproved(p.id, MEDIA_TYPE.AUDIO)(state)
hasRaisedHand(p) && !isParticipantApproved(p.id, MEDIA_TYPE.AUDIO)(state)
&& dispatch(participantPendingAudio(p));
});
}