From a59bf7c002955ae82a1c4bfd8b68432f575c048d Mon Sep 17 00:00:00 2001 From: RMidhunSuresh Date: Tue, 11 Jan 2022 20:57:29 +0530 Subject: [PATCH] Fix looking in allEntries --- src/matrix/room/timeline/Timeline.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/matrix/room/timeline/Timeline.js b/src/matrix/room/timeline/Timeline.js index c5fc98a2..bb6554b8 100644 --- a/src/matrix/room/timeline/Timeline.js +++ b/src/matrix/room/timeline/Timeline.js @@ -422,8 +422,11 @@ export class Timeline { } getFromAllEntriesById(eventId) { - for (let i = 0; i < this.entries.length; i += 1) { - const entry = this.entries.get(i); + if (!this._allEntries) { + // if allEntries isn't loaded yet, fallback to looking only in remoteEntries + return this.getByEventId(eventId); + } + for (const entry of this._allEntries) { if (entry.id === eventId) { return entry; }