No need to await here

This commit is contained in:
RMidhunSuresh 2023-05-17 16:19:46 +05:30
parent 5890fcdc9a
commit f10217c591

View File

@ -29,9 +29,7 @@ import {RetainedValue} from "../../../utils/RetainedValue";
export class Timeline extends RetainedValue { export class Timeline extends RetainedValue {
constructor({roomId, storage, closeCallback, fragmentIdComparer, pendingEvents, clock, powerLevelsObservable, hsApi}) { constructor({roomId, storage, closeCallback, fragmentIdComparer, pendingEvents, clock, powerLevelsObservable, hsApi}) {
super(() => { super(() => { this.dispose(); });
this.dispose();
});
this._roomId = roomId; this._roomId = roomId;
this._storage = storage; this._storage = storage;
this._closeCallback = closeCallback; this._closeCallback = closeCallback;
@ -89,7 +87,7 @@ export class Timeline extends RetainedValue {
const readerRequest = this._disposables.track(this._timelineReader.readFromEnd(20, txn, log)); const readerRequest = this._disposables.track(this._timelineReader.readFromEnd(20, txn, log));
try { try {
const entries = await readerRequest.complete(); const entries = await readerRequest.complete();
await this._loadContextEntriesWhereNeeded(entries); this._loadContextEntriesWhereNeeded(entries);
this._setupEntries(entries); this._setupEntries(entries);
} finally { } finally {
this._disposables.disposeTracked(readerRequest); this._disposables.disposeTracked(readerRequest);