Include local screen share participant and null checks

This commit is contained in:
Bogdan Duduman 2023-02-23 09:42:50 +02:00
parent bbbe5587f6
commit 19f8c252b5
1 changed files with 8 additions and 1 deletions

View File

@ -275,10 +275,17 @@ export function getVirtualScreenshareParticipantOwnerId(id: string) {
*/
export function getVirtualScreenshareParticipantOwnerIds(stateful: IStateful) {
const virtualScreenshareParticipants = toState(stateful)['features/base/participants']
.sortedRemoteVirtualScreenshareParticipants;
.sortedRemoteVirtualScreenshareParticipants ?? new Map();
const virtualScreenshareParticipantIds = Array.from(virtualScreenshareParticipants.keys())
.map(id => getVirtualScreenshareParticipantOwnerId(id));
const localScreenShareParticipantId = getLocalScreenShareParticipant(stateful)?.id;
if (localScreenShareParticipantId) {
return [
...virtualScreenshareParticipantIds,
getVirtualScreenshareParticipantOwnerId(localScreenShareParticipantId) ];
}
return virtualScreenshareParticipantIds;
}