From 012986df65d128eb3ed84565792b22cfcb6a0947 Mon Sep 17 00:00:00 2001 From: RMidhunSuresh Date: Wed, 17 May 2023 16:26:49 +0530 Subject: [PATCH] Fix misleading comment --- src/matrix/room/BaseRoom.js | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/matrix/room/BaseRoom.js b/src/matrix/room/BaseRoom.js index 54824700..fe0db293 100644 --- a/src/matrix/room/BaseRoom.js +++ b/src/matrix/room/BaseRoom.js @@ -545,6 +545,7 @@ export class BaseRoom extends EventEmitter { async openTimeline(log = null) { return await this._platform.logger.wrapOrRun(log, "open timeline", async log => { if (this._timelineLoadPromise) { + // This is to prevent races between multiple calls to this method await this._timelineLoadPromise; } let resolve; @@ -556,10 +557,6 @@ export class BaseRoom extends EventEmitter { }); log.set("id", this.id); if (this._timeline) { - /** - * It's possible that timeline was created but timeline.load() has not yet finished. - * We only return the timeline when it has completely loaded! - */ log.log({ l: "Returning existing timeline" }); resolve(); return this._timeline;