From 7cc3d4b91a5667e64e66f5946074803906639c58 Mon Sep 17 00:00:00 2001 From: RMidhunSuresh Date: Tue, 7 Dec 2021 20:26:54 +0530 Subject: [PATCH] Emit updated entries --- src/matrix/room/timeline/Timeline.js | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/matrix/room/timeline/Timeline.js b/src/matrix/room/timeline/Timeline.js index 1488a307..bc81008d 100644 --- a/src/matrix/room/timeline/Timeline.js +++ b/src/matrix/room/timeline/Timeline.js @@ -80,7 +80,7 @@ export class Timeline { const readerRequest = this._disposables.track(this._timelineReader.readFromEnd(20, txn, log)); try { const entries = await readerRequest.complete(); - await this._loadRelatedEvents(entries); + this._loadRelatedEvents(entries); this._setupEntries(entries); } finally { this._disposables.disposeTracked(readerRequest); @@ -214,9 +214,9 @@ export class Timeline { } /** @package */ - async replaceEntries(entries) { + replaceEntries(entries) { this._addLocalRelationsToNewRemoteEntries(entries); - await this._loadRelatedEvents(entries); + this._loadRelatedEvents(entries); for (const entry of entries) { try { this._remoteEntries.getAndUpdate(entry, Timeline._entryUpdater); @@ -238,9 +238,9 @@ export class Timeline { } /** @package */ - async addEntries(newEntries) { + addEntries(newEntries) { this._addLocalRelationsToNewRemoteEntries(newEntries); - await this._loadRelatedEvents(newEntries); + this._loadRelatedEvents(newEntries); this._remoteEntries.setManySorted(newEntries); } @@ -261,6 +261,8 @@ export class Timeline { } if (contextEvent) { entry.setContextEntry(contextEvent); + // emit this change + this._remoteEntries.update(entry); } } }