mirror of
https://github.com/vector-im/element-call.git
synced 2026-02-14 04:37:03 +00:00
Only show the expand button in spotlight layout (#2510)
It has no effect in any layout other than spotlight, and we've decided to hide it rather than spending effort to make it do something.
This commit is contained in:
@@ -526,10 +526,6 @@ export class CallViewModel extends ViewModel {
|
||||
shareReplay(1),
|
||||
);
|
||||
|
||||
public toggleSpotlightExpanded(): void {
|
||||
this.spotlightExpandedToggle.next();
|
||||
}
|
||||
|
||||
private readonly gridModeUserSelection = new Subject<GridMode>();
|
||||
/**
|
||||
* The layout mode of the media tile grid.
|
||||
@@ -665,6 +661,25 @@ export class CallViewModel extends ViewModel {
|
||||
shareReplay(1),
|
||||
);
|
||||
|
||||
// To work around https://github.com/crimx/observable-hooks/issues/131 we must
|
||||
// wrap the emitted function here in a non-function wrapper type
|
||||
public readonly toggleSpotlightExpanded: Observable<
|
||||
readonly [(() => void) | null]
|
||||
> = this.layout.pipe(
|
||||
map(
|
||||
(l) =>
|
||||
l.type === "spotlight-landscape" || l.type === "spotlight-expanded",
|
||||
),
|
||||
distinctUntilChanged(),
|
||||
map(
|
||||
(enabled) =>
|
||||
[
|
||||
enabled ? (): void => this.spotlightExpandedToggle.next() : null,
|
||||
] as const,
|
||||
),
|
||||
shareReplay(1),
|
||||
);
|
||||
|
||||
public constructor(
|
||||
// A call is permanently tied to a single Matrix room and LiveKit room
|
||||
private readonly matrixRoom: MatrixRoom,
|
||||
|
||||
Reference in New Issue
Block a user