From 100100e9ea96dc91929448ec6642fc68ebda128b Mon Sep 17 00:00:00 2001 From: Robin Date: Tue, 4 Jun 2024 16:06:40 -0400 Subject: [PATCH] Only switch to spotlight for remote screen shares --- src/state/CallViewModel.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/state/CallViewModel.ts b/src/state/CallViewModel.ts index cc5afc463..3bbc0a2d7 100644 --- a/src/state/CallViewModel.ts +++ b/src/state/CallViewModel.ts @@ -376,9 +376,9 @@ export class CallViewModel extends ViewModel { shareReplay(1), ); - private readonly hasScreenShares: Observable = + private readonly hasRemoteScreenShares: Observable = this.screenShares.pipe( - map((ms) => ms.length > 0), + map((ms) => ms.find((m) => !m.vm.local) !== undefined), distinctUntilChanged(), ); @@ -474,7 +474,7 @@ export class CallViewModel extends ViewModel { this.gridModeUserSelection, // If the user hasn't selected spotlight and somebody starts screen sharing, // automatically switch to spotlight mode and reset when screen sharing ends - this.hasScreenShares.pipe( + this.hasRemoteScreenShares.pipe( withLatestFrom(this.gridModeUserSelection.pipe(startWith(null))), concatMap(([hasScreenShares, userSelection]) => userSelection === "spotlight"