From 6c03bb438259c938f84e58696b58a7df333facc8 Mon Sep 17 00:00:00 2001 From: Timo K Date: Mon, 25 Mar 2024 19:47:15 +0100 Subject: [PATCH] dont calll anything async in viewRoom (RoomViewStore) this caused the one room delay. Signed-off-by: Timo K --- src/stores/CallStore.ts | 4 ++-- src/stores/RoomViewStore.tsx | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/stores/CallStore.ts b/src/stores/CallStore.ts index 5ebc51bcf5f3..9338ea7db0d0 100644 --- a/src/stores/CallStore.ts +++ b/src/stores/CallStore.ts @@ -179,8 +179,8 @@ export class CallStore extends AsyncStoreWithClient<{}> { * @param roomId The room's ID. * @returns The active call. */ - public async getActiveCall(roomId: string): Promise { - const call = await this.getCall(roomId); + public getActiveCall(roomId: string): Call | null { + const call = this.getCall(roomId); return call !== null && this.activeCalls.has(call) ? call : null; } diff --git a/src/stores/RoomViewStore.tsx b/src/stores/RoomViewStore.tsx index 795813c9ec89..dfe910d57f18 100644 --- a/src/stores/RoomViewStore.tsx +++ b/src/stores/RoomViewStore.tsx @@ -473,7 +473,7 @@ export class RoomViewStore extends EventEmitter { payload.view_call ?? (payload.room_id === this.state.roomId ? this.state.viewingCall - : (await CallStore.instance.getActiveCall(payload.room_id)) !== null), + : CallStore.instance.getActiveCall(payload.room_id) !== null), }; // Allow being given an event to be replied to when switching rooms but sanity check its for this room