Replace entry in contextEntryNotInTimeline

This commit is contained in:
RMidhunSuresh 2022-01-07 17:11:42 +05:30
parent cfbb6d4250
commit c6484f1eac

View File

@ -224,11 +224,14 @@ export class Timeline {
/** @package */ /** @package */
replaceEntries(entries) { replaceEntries(entries) {
this._addLocalRelationsToNewRemoteEntries(entries); this._addLocalRelationsToNewRemoteEntries(entries);
this._updateEntriesNotInTimeline(entries);
this._loadContextEntriesWhereNeeded(entries);
for (const entry of entries) { for (const entry of entries) {
try { try {
this._remoteEntries.getAndUpdate(entry, Timeline._entryUpdater); this._remoteEntries.getAndUpdate(entry, Timeline._entryUpdater);
const oldEntry = this._contextEntriesNotInTimeline.get(entry.id)
if (oldEntry) {
Timeline._entryUpdater(oldEntry, entry);
}
this._contextEntriesNotInTimeline.set(entry.id, entry);
// Since this entry changed, all dependent entries should be updated // Since this entry changed, all dependent entries should be updated
entry.contextForEntries?.forEach(e => this._updateEntry(e)); entry.contextForEntries?.forEach(e => this._updateEntry(e));
} catch (err) { } catch (err) {