From ca135d471e97d5af96b0dd9d46aec2c178d1975c Mon Sep 17 00:00:00 2001 From: Robin Date: Wed, 11 Sep 2024 01:27:24 -0400 Subject: [PATCH] React more actively to changes in room membership --- src/state/CallViewModel.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/state/CallViewModel.ts b/src/state/CallViewModel.ts index 219df600..6cd8495b 100644 --- a/src/state/CallViewModel.ts +++ b/src/state/CallViewModel.ts @@ -16,7 +16,11 @@ import { ParticipantEvent, RemoteParticipant, } from "livekit-client"; -import { Room as MatrixRoom, RoomMember } from "matrix-js-sdk/src/matrix"; +import { + Room as MatrixRoom, + RoomMember, + RoomStateEvent, +} from "matrix-js-sdk/src/matrix"; import { EMPTY, Observable, @@ -321,6 +325,8 @@ export class CallViewModel extends ViewModel { this.remoteParticipants, observeParticipantMedia(this.livekitRoom.localParticipant), duplicateTiles.value, + // Also react to changes in the list of members + fromEvent(this.matrixRoom, RoomStateEvent.Update).pipe(startWith(null)), ]).pipe( scan( (