From 3975db7a68dbd57f78d7855e7d1ea92c75e79680 Mon Sep 17 00:00:00 2001 From: Jaya Allamsetty <54324652+jallamsetty1@users.noreply.github.com> Date: Fri, 12 Aug 2022 13:44:09 -0400 Subject: [PATCH] fix(fimstrip): Do not re-sort the active speakers if dominant speaker is visible. Fixes a case where re-sorting doesn't happen even when dominant speaker is currently not visible. --- react/features/base/participants/functions.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/react/features/base/participants/functions.ts b/react/features/base/participants/functions.ts index 7cda4a4a9..ce9ceef09 100644 --- a/react/features/base/participants/functions.ts +++ b/react/features/base/participants/functions.ts @@ -64,6 +64,7 @@ const AVATAR_CHECKER_FUNCTIONS = [ export function getActiveSpeakersToBeDisplayed(stateful: IStore | Function) { const state = toState(stateful); const { + dominantSpeaker, fakeParticipants, sortedRemoteScreenshares, sortedRemoteVirtualScreenshareParticipants, @@ -72,8 +73,8 @@ export function getActiveSpeakersToBeDisplayed(stateful: IStore | Function) { const { visibleRemoteParticipants } = state['features/filmstrip']; const activeSpeakers = new Map(speakersList); - // Do not re-sort the active speakers if all of them are currently visible. - if (typeof visibleRemoteParticipants === 'undefined' || activeSpeakers.size <= visibleRemoteParticipants.size) { + // Do not re-sort the active speakers if dominant speaker is currently visible. + if (dominantSpeaker && visibleRemoteParticipants.has(dominantSpeaker)) { return activeSpeakers; } let availableSlotsForActiveSpeakers = visibleRemoteParticipants.size;