Fix misleading comment

This commit is contained in:
RMidhunSuresh 2023-05-17 16:26:49 +05:30
parent 489f00f57a
commit 012986df65

View File

@ -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;