fix(participants-pane): Get the correct participantCount for multi-stream.

Do not add virtual screenshare participants to participantCount.
This commit is contained in:
Jaya Allamsetty 2022-08-01 11:31:38 -04:00
parent ffe66a1148
commit 14c4b19c9b
2 changed files with 5 additions and 13 deletions

View File

@ -244,7 +244,7 @@ export function getParticipantCount(stateful: Object | Function) {
sortedRemoteVirtualScreenshareParticipants
} = state['features/base/participants'];
if (getSourceNameSignalingFeatureFlag(state)) {
if (getMultipleVideoSupportFeatureFlag(state)) {
return remote.size - fakeParticipants.size - sortedRemoteVirtualScreenshareParticipants.size + (local ? 1 : 0);
}
@ -286,7 +286,7 @@ export function getFakeParticipants(stateful: Object | Function) {
export function getRemoteParticipantCount(stateful: Object | Function) {
const state = toState(stateful)['features/base/participants'];
if (getSourceNameSignalingFeatureFlag(state)) {
if (getMultipleVideoSupportFeatureFlag(state)) {
return state.remote.size - state.sortedRemoteVirtualScreenshareParticipants.size;
}
@ -306,7 +306,7 @@ export function getParticipantCountWithFake(stateful: Object | Function) {
const state = toState(stateful);
const { local, localScreenShare, remote } = state['features/base/participants'];
if (getSourceNameSignalingFeatureFlag(state)) {
if (getMultipleVideoSupportFeatureFlag(state)) {
return remote.size + (local ? 1 : 0) + (localScreenShare ? 1 : 0);
}

View File

@ -10,10 +10,7 @@ import useContextMenu from '../../../base/components/context-menu/useContextMenu
import participantsPaneTheme from '../../../base/components/themes/participantsPaneTheme.json';
import { isToolbarButtonEnabled } from '../../../base/config/functions.web';
import { MEDIA_TYPE } from '../../../base/media';
import {
getParticipantById,
getParticipantCountWithFake
} from '../../../base/participants';
import { getParticipantById } from '../../../base/participants';
import { connect } from '../../../base/redux';
import { normalizeAccents } from '../../../base/util/strings';
import { getBreakoutRooms, getCurrentRoomId, isInBreakoutRoom } from '../../../breakout-rooms/functions';
@ -161,14 +158,9 @@ function _mapStateToProps(state): Object {
return !participant.isVirtualScreenshareParticipant;
});
// This is very important as getRemoteParticipants is not changing its reference object
// and we will not re-render on change, but if count changes we will do
const participantsCount = getParticipantCountWithFake(state);
const participantsCount = sortedParticipantIds.length;
const showInviteButton = shouldRenderInviteButton(state) && isToolbarButtonEnabled('invite', state);
const overflowDrawer = showOverflowDrawer(state);
const currentRoomId = getCurrentRoomId(state);
const currentRoom = getBreakoutRooms(state)[currentRoomId];