From 3d00881508673d9cca15f51a351f895c5c6ec955 Mon Sep 17 00:00:00 2001 From: Bruno Windels Date: Fri, 14 Jan 2022 19:05:30 +0100 Subject: [PATCH] don't look in remoteEntries when already found --- src/matrix/room/timeline/Timeline.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/matrix/room/timeline/Timeline.js b/src/matrix/room/timeline/Timeline.js index 0530fdad..cb342da0 100644 --- a/src/matrix/room/timeline/Timeline.js +++ b/src/matrix/room/timeline/Timeline.js @@ -323,7 +323,9 @@ export class Timeline { // before looking into remoteEntries, check the entries // that about to be added first let contextEvent = entries.find(e => e.id === id); - contextEvent = this._findLoadedEventById(id); + if (!contextEvent) { + contextEvent = this._findLoadedEventById(id); + } if (contextEvent) { entry.setContextEntry(contextEvent); // we don't emit an update here, as the add or update