don't look in remoteEntries when already found

This commit is contained in:
Bruno Windels 2022-01-14 19:05:30 +01:00
parent 7197e5427f
commit 3d00881508

View file

@ -323,7 +323,9 @@ export class Timeline {
// before looking into remoteEntries, check the entries // before looking into remoteEntries, check the entries
// that about to be added first // that about to be added first
let contextEvent = entries.find(e => e.id === id); let contextEvent = entries.find(e => e.id === id);
if (!contextEvent) {
contextEvent = this._findLoadedEventById(id); contextEvent = this._findLoadedEventById(id);
}
if (contextEvent) { if (contextEvent) {
entry.setContextEntry(contextEvent); entry.setContextEntry(contextEvent);
// we don't emit an update here, as the add or update // we don't emit an update here, as the add or update