mirror of
https://github.com/element-hq/element-call.git
synced 2026-10-22 21:53:14 +00:00
Fold map operation into combineLatest
This commit is contained in:
1 parent
131bdc3522
commit
3b1ce22b71
1 file changed
+11
-11
+11
-11
@@ -269,21 +269,21 @@ class ControlledAudioOutput
|
||||
this.deviceSelection$.next(id);
|
||||
}
|
||||
|
||||
public readonly selected$ = combineLatest([
|
||||
this.available$,
|
||||
merge(
|
||||
controlledOutputSelection$.pipe(startWith(undefined)),
|
||||
this.deviceSelection$,
|
||||
),
|
||||
]).pipe(
|
||||
map(([available, selectId]) => {
|
||||
public readonly selected$ = combineLatest(
|
||||
[
|
||||
this.available$,
|
||||
merge(
|
||||
controlledOutputSelection$.pipe(startWith(undefined)),
|
||||
this.deviceSelection$,
|
||||
),
|
||||
],
|
||||
(available, selectId) => {
|
||||
const id = selectId ?? available.keys().next().value;
|
||||
return id
|
||||
? { id, virtualEarpiece: id === EARPIECE_CONFIG_ID }
|
||||
: undefined;
|
||||
}),
|
||||
this.scope.state(),
|
||||
);
|
||||
},
|
||||
).pipe(this.scope.state());
|
||||
|
||||
public constructor(private readonly scope: ObservableScope) {
|
||||
this.selected$.subscribe((device) => {
|
||||
|
||||
Reference in new issue
Block a user