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 Jun 7, 2024
1 parent 78a9e85 commit a8dbdce
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 @@ -377,9 +377,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 @@ -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"
Expand Down

0 comments on commit a8dbdce

Please sign in to comment.