From a8dbdcec15b3d5725ac6f86f17cdc1947c7a773e 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 73231416c..5feb6585d 100644 --- a/src/state/CallViewModel.ts +++ b/src/state/CallViewModel.ts @@ -377,9 +377,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(), ); @@ -477,7 +477,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"