From bcbf7a90f0d5c3064aef772e68ca8c24e3ec3564 Mon Sep 17 00:00:00 2001 From: Robin Date: Tue, 14 Oct 2025 12:00:00 -0400 Subject: [PATCH] Initialize preferredTransport$ in a less unusual way --- src/state/CallViewModel.ts | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/state/CallViewModel.ts b/src/state/CallViewModel.ts index e8f49d71..a2a224f3 100644 --- a/src/state/CallViewModel.ts +++ b/src/state/CallViewModel.ts @@ -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>; + 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())