Skip to content

Commit

Permalink
Only switch to spotlight for remote screen shares
Browse files Browse the repository at this point in the history
  • Loading branch information
robintown committed Jul 3, 2024
1 parent b90aa7d commit 100100e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/state/CallViewModel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -376,9 +376,9 @@ export class CallViewModel extends ViewModel {
shareReplay(1),
);

private readonly hasScreenShares: Observable<boolean> =
private readonly hasRemoteScreenShares: Observable<boolean> =
this.screenShares.pipe(
map((ms) => ms.length > 0),
map((ms) => ms.find((m) => !m.vm.local) !== undefined),
distinctUntilChanged(),
);

Expand Down Expand Up @@ -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"
Expand Down

0 comments on commit 100100e

Please sign in to comment.