React more actively to changes in room membership

This commit is contained in:
Robin 2024-09-11 01:27:24 -04:00
parent 1b5b9342fe
commit ca135d471e

View File

@ -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(
(