Initialize preferredTransport$ in a less unusual way

This commit is contained in:
Robin
2025-10-14 12:00:00 -04:00
parent 2de7a20d8a
commit bcbf7a90f0

View File

@@ -288,7 +288,9 @@ export class CallViewModel extends ViewModel {
* The transport that we would personally prefer to publish on (if not for the
* transport preferences of others, perhaps).
*/
private readonly preferredTransport$: Observable<Async<LivekitTransport>>;
private readonly preferredTransport$ = this.scope.behavior(
async$(makeTransport(this.matrixRTCSession)),
);
/**
* Lists the transports used by ourselves, plus all other MatrixRTC session
@@ -1802,10 +1804,6 @@ export class CallViewModel extends ViewModel {
) {
super();
this.preferredTransport$ = async$(
makeTransport(this.matrixRTCSession),
).pipe(this.scope.bind());
// Start and stop local and remote connections as needed
this.connectionInstructions$
.pipe(this.scope.bind())