diff --git a/src/state/CallViewModel.ts b/src/state/CallViewModel.ts index 20105a85..5ff3d8d3 100644 --- a/src/state/CallViewModel.ts +++ b/src/state/CallViewModel.ts @@ -401,7 +401,9 @@ export class CallViewModel extends ViewModel { * The raw list of RemoteParticipants as reported by LiveKit */ private readonly rawRemoteParticipants$: Observable = - connectedParticipantsObserver(this.livekitRoom).behavior(this.scope); + connectedParticipantsObserver(this.livekitRoom) + .pipe(startWith([])) + .behavior(this.scope); /** * Lists of RemoteParticipants to "hold" on display, even if LiveKit claims that @@ -507,6 +509,21 @@ export class CallViewModel extends ViewModel { ) .behavior(this.scope); + public readonly handsRaised$ = this.handsRaisedSubject$.behavior(this.scope); + + public readonly reactions$ = this.reactionsSubject$ + .pipe( + map((v) => + Object.fromEntries( + Object.entries(v).map(([a, { reactionOption }]) => [ + a, + reactionOption, + ]), + ), + ), + ) + .behavior(this.scope); + /** * List of MediaItems that we want to display */ @@ -1313,21 +1330,6 @@ export class CallViewModel extends ViewModel { }, ).behavior(this.scope); - public readonly reactions$ = this.reactionsSubject$ - .pipe( - map((v) => - Object.fromEntries( - Object.entries(v).map(([a, { reactionOption }]) => [ - a, - reactionOption, - ]), - ), - ), - ) - .behavior(this.scope); - - public readonly handsRaised$ = this.handsRaisedSubject$.behavior(this.scope); - /** * Emits an array of reactions that should be visible on the screen. */ diff --git a/src/state/MuteAllAudioModel.test.ts b/src/state/MuteAllAudioModel.test.ts index d7b4e0c4..66f17f61 100644 --- a/src/state/MuteAllAudioModel.test.ts +++ b/src/state/MuteAllAudioModel.test.ts @@ -26,11 +26,9 @@ test("muteAllAudio$", () => { muteAllAudio.unsubscribe(); - expect(valueMock).toHaveBeenCalledTimes(6); + expect(valueMock).toHaveBeenCalledTimes(4); expect(valueMock).toHaveBeenNthCalledWith(1, false); // startWith([false, muteAllAudioSetting.getValue()]); expect(valueMock).toHaveBeenNthCalledWith(2, true); // setAudioEnabled$.next(false); expect(valueMock).toHaveBeenNthCalledWith(3, false); // setAudioEnabled$.next(true); - expect(valueMock).toHaveBeenNthCalledWith(4, false); // muteAllAudioSetting.setValue(false); - expect(valueMock).toHaveBeenNthCalledWith(5, true); // muteAllAudioSetting.setValue(true); - expect(valueMock).toHaveBeenNthCalledWith(6, true); // setAudioEnabled$.next(false); + expect(valueMock).toHaveBeenNthCalledWith(4, true); // muteAllAudioSetting.setValue(true); });