From 4fa32bac2fb87632c6dd580dafc5c96a3b42c1a2 Mon Sep 17 00:00:00 2001 From: RMidhunSuresh Date: Fri, 14 Jan 2022 16:14:06 +0530 Subject: [PATCH] check only in remoteEntries --- src/matrix/room/timeline/Timeline.js | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/src/matrix/room/timeline/Timeline.js b/src/matrix/room/timeline/Timeline.js index 5592ff88..816ae3d1 100644 --- a/src/matrix/room/timeline/Timeline.js +++ b/src/matrix/room/timeline/Timeline.js @@ -344,7 +344,7 @@ export class Timeline { * @returns entry if found, undefined otherwise */ _findLoadedEventById(eventId) { - return this.getFromAllEntriesById(eventId) ?? this._contextEntriesNotInTimeline.get(eventId); + return this.getByEventId(eventId) ?? this._contextEntriesNotInTimeline.get(eventId); } async _getEventFromStorage(eventId) { @@ -423,19 +423,6 @@ export class Timeline { return null; } - getFromAllEntriesById(eventId) { - 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; - } - } - return null; - } - /** @public */ get entries() { return this._allEntries;