From bf5128cfee48ddcd1c09ccbbe003ab1c376c2be5 Mon Sep 17 00:00:00 2001 From: Robin Date: Tue, 6 Aug 2024 17:12:13 -0400 Subject: [PATCH] Don't show local media on top of itself If you were the only one in the call, you could get a broken-looking view in which the local tile is shown in the spotlight, and it's also shown in the PiP. This is redundant. --- src/state/CallViewModel.ts | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/src/state/CallViewModel.ts b/src/state/CallViewModel.ts index dcbb93cfd..acd145b9b 100644 --- a/src/state/CallViewModel.ts +++ b/src/state/CallViewModel.ts @@ -488,11 +488,17 @@ export class CallViewModel extends ViewModel { ? ([of(screenShares.map((m) => m.vm)), this.spotlightSpeaker] as const) : ([ this.spotlightSpeaker.pipe(map((speaker) => [speaker!])), - this.localUserMedia.pipe( - switchMap((vm) => - vm.alwaysShow.pipe( - map((alwaysShow) => (alwaysShow ? vm : null)), - ), + this.spotlightSpeaker.pipe( + switchMap((speaker) => + speaker.local + ? of(null) + : this.localUserMedia.pipe( + switchMap((vm) => + vm.alwaysShow.pipe( + map((alwaysShow) => (alwaysShow ? vm : null)), + ), + ), + ), ), ), ] as const),