mirror of
https://github.com/vector-im/hydrogen-web.git
synced 2024-12-23 03:25:12 +01:00
Replace entry in contextEntryNotInTimeline
This commit is contained in:
parent
cfbb6d4250
commit
c6484f1eac
@ -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) {
|
||||||
|
Loading…
Reference in New Issue
Block a user