diff --git a/src/state/CallViewModel.ts b/src/state/CallViewModel.ts index 00541877..a83341bd 100644 --- a/src/state/CallViewModel.ts +++ b/src/state/CallViewModel.ts @@ -443,7 +443,7 @@ export class CallViewModel extends ViewModel { remoteParticipants, { participant: localParticipant }, duplicateTiles, - _participantChange, + _membershipsChanged, nonMemberTiles, ], ) => { @@ -682,16 +682,11 @@ export class CallViewModel extends ViewModel { ); private readonly spotlightAndPip: Observable< - [Observable, Observable] + [Observable, Observable] > = this.screenShares.pipe( map((screenShares) => screenShares.length > 0 - ? ([ - of(screenShares.map((m) => m.vm)), - this.spotlightSpeaker.pipe( - map((speaker) => (speaker && speaker) ?? null), - ), - ] as const) + ? ([of(screenShares.map((m) => m.vm)), this.spotlightSpeaker] as const) : ([ this.spotlightSpeaker.pipe( map((speaker) => (speaker && [speaker]) ?? []), @@ -700,15 +695,15 @@ export class CallViewModel extends ViewModel { switchMap((speaker) => speaker ? speaker.local - ? of(null) + ? of(undefined) : this.localUserMedia.pipe( switchMap((vm) => vm.alwaysShow.pipe( - map((alwaysShow) => (alwaysShow ? vm : null)), + map((alwaysShow) => (alwaysShow ? vm : undefined)), ), ), ) - : of(null), + : of(undefined), ), ), ] as const), diff --git a/src/state/MediaViewModel.ts b/src/state/MediaViewModel.ts index e3f244f9..e005fbc3 100644 --- a/src/state/MediaViewModel.ts +++ b/src/state/MediaViewModel.ts @@ -78,7 +78,7 @@ export function observeTrackReference( participant: Observable, source: Track.Source, ): Observable { - const obs = participant.pipe( + return participant.pipe( switchMap((p) => { if (p) { return observeParticipantMedia(p).pipe( @@ -94,7 +94,6 @@ export function observeTrackReference( } }), ); - return obs; } function observeRemoteTrackReceivingOkay( @@ -232,7 +231,7 @@ abstract class BaseMediaViewModel extends ViewModel { // TODO: Fully separate the data layer from the UI layer by keeping the // member object internal public readonly member: RoomMember | undefined, - // We dont necassarly have a participant if a user connects via MatrixRTC but not (not yet) through + // We dont necessarily have a participant if a user connects via MatrixRTC but not (not yet) through // livekit. protected readonly participant: Observable< LocalParticipant | RemoteParticipant | undefined