Skip to content

Jitsi Meet - Secure, Simple and Scalable Video Conferences that you use as a standalone app or embed in your web application.

feat(participants): check for raisedHandsQueue length before notifying participant to speak

Calin-Teodor4834fb7b6f23
diff --git a/react/features/base/participants/reducer.ts b/react/features/base/participants/reducer.ts
index 25aad9b55a..d1318b42a2 100644
--- a/react/features/base/participants/reducer.ts
+++ b/react/features/base/participants/reducer.ts
@@ -118,13 +118,13 @@ ReducerRegistry.register<IParticipantsState>('features/base/participants',
case NOTIFIED_TO_SPEAK: {
return {
...state,
- raisedHandsQueue: [
+ raisedHandsQueue: state.raisedHandsQueue.length ? [
{
...state.raisedHandsQueue[0],
hasBeenNotified: true
},
...state.raisedHandsQueue.slice(1)
- ]
+ ] : []
};
}
diff --git a/react/features/base/participants/subscriber.ts b/react/features/base/participants/subscriber.ts
index f76ec220f8..ac40b5346b 100644
--- a/react/features/base/participants/subscriber.ts
+++ b/react/features/base/participants/subscriber.ts
@@ -33,7 +33,7 @@ StateListenerRegistry.register(
StateListenerRegistry.register(
/* selector */ state => state['features/base/participants'].raisedHandsQueue,
/* listener */ (raisedHandsQueue, store) => {
- if (isNextToSpeak(store.getState()) && !hasBeenNotified(store.getState())) {
+ if (raisedHandsQueue.length && isNextToSpeak(store.getState()) && !hasBeenNotified(store.getState())) {
_notifyNextSpeakerInRaisedHandQueue(store);
}
}