From 95ce4c56ad6eab5baccf1c82775647a4cc052e7f Mon Sep 17 00:00:00 2001 From: Half-Shot Date: Tue, 14 Jan 2025 14:24:39 +0000 Subject: [PATCH] fix missing media tiles on missing member --- src/state/CallViewModel.ts | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/state/CallViewModel.ts b/src/state/CallViewModel.ts index 2fb1acb94..a52fd9af4 100644 --- a/src/state/CallViewModel.ts +++ b/src/state/CallViewModel.ts @@ -364,13 +364,13 @@ type MediaItem = UserMedia | ScreenShare; function getRoomMemberFromRtcMember( rtcMember: CallMembership, room: Room, -): { id: string; member: RoomMember | null } { +): { id: string; member: RoomMember | undefined } { // WARN! This is not exactly the sender but the user defined in the state key. // This will be available once we change to the new "member as object" format in the MatrixRTC object. let id = rtcMember.sender + ":" + rtcMember.deviceId; if (!rtcMember.sender) { - return { id, member: null }; + return { id, member: undefined }; } if ( rtcMember.sender === room.client.getUserId() && @@ -379,7 +379,7 @@ function getRoomMemberFromRtcMember( id = "local"; } - const member = room.getMember(rtcMember.sender); + const member = room.getMember(rtcMember.sender) ?? undefined; return { id, member }; } @@ -551,7 +551,6 @@ export class CallViewModel extends ViewModel { "Could not find member for media id: ", livekitParticipantId, ); - break; } for (let i = 0; i < 1 + duplicateTiles; i++) { const indexedMediaId = `${livekitParticipantId}:${i}`;