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.
This commit is contained in:
Jaya Allamsetty 2022-08-12 13:44:09 -04:00
parent 02e4d2b902
commit 3975db7a68
1 changed files with 3 additions and 2 deletions

View File

@ -64,6 +64,7 @@ const AVATAR_CHECKER_FUNCTIONS = [
export function getActiveSpeakersToBeDisplayed(stateful: IStore | Function) { export function getActiveSpeakersToBeDisplayed(stateful: IStore | Function) {
const state = toState(stateful); const state = toState(stateful);
const { const {
dominantSpeaker,
fakeParticipants, fakeParticipants,
sortedRemoteScreenshares, sortedRemoteScreenshares,
sortedRemoteVirtualScreenshareParticipants, sortedRemoteVirtualScreenshareParticipants,
@ -72,8 +73,8 @@ export function getActiveSpeakersToBeDisplayed(stateful: IStore | Function) {
const { visibleRemoteParticipants } = state['features/filmstrip']; const { visibleRemoteParticipants } = state['features/filmstrip'];
const activeSpeakers = new Map(speakersList); const activeSpeakers = new Map(speakersList);
// Do not re-sort the active speakers if all of them are currently visible. // Do not re-sort the active speakers if dominant speaker is currently visible.
if (typeof visibleRemoteParticipants === 'undefined' || activeSpeakers.size <= visibleRemoteParticipants.size) { if (dominantSpeaker && visibleRemoteParticipants.has(dominantSpeaker)) {
return activeSpeakers; return activeSpeakers;
} }
let availableSlotsForActiveSpeakers = visibleRemoteParticipants.size; let availableSlotsForActiveSpeakers = visibleRemoteParticipants.size;