Skip to content

Commit

Permalink
fix missing media tiles on missing member
Browse files Browse the repository at this point in the history
  • Loading branch information
Half-Shot committed Jan 14, 2025
1 parent c2dae5b commit 95ce4c5
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/state/CallViewModel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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() &&
Expand All @@ -379,7 +379,7 @@ function getRoomMemberFromRtcMember(
id = "local";
}

const member = room.getMember(rtcMember.sender);
const member = room.getMember(rtcMember.sender) ?? undefined;
return { id, member };
}

Expand Down Expand Up @@ -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}`;
Expand Down

0 comments on commit 95ce4c5

Please sign in to comment.