Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

Commit

Permalink
dont calll anything async in viewRoom (RoomViewStore) this caused the…
Browse files Browse the repository at this point in the history
… one room delay.

Signed-off-by: Timo K <toger5@hotmail.de>
  • Loading branch information
toger5 committed Mar 25, 2024
1 parent cd04337 commit 6c03bb4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/stores/CallStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<Call | null> {
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;
}

Expand Down
2 changes: 1 addition & 1 deletion src/stores/RoomViewStore.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 6c03bb4

Please sign in to comment.