diff --git a/src/matrix/room/timeline/Timeline.js b/src/matrix/room/timeline/Timeline.js index 7743ddb8..5c9091df 100644 --- a/src/matrix/room/timeline/Timeline.js +++ b/src/matrix/room/timeline/Timeline.js @@ -76,7 +76,9 @@ export class Timeline { replaceEntries(entries) { for (const entry of entries) { - this._remoteEntries.replace(entry); + // this will use the comparator and thus + // check for equality using the compare method in BaseEntry + this._remoteEntries.update(entry); } } diff --git a/src/observable/list/SortedArray.js b/src/observable/list/SortedArray.js index 6d3e90c6..193661cf 100644 --- a/src/observable/list/SortedArray.js +++ b/src/observable/list/SortedArray.js @@ -41,11 +41,11 @@ export class SortedArray extends BaseObservableList { } } - replace(item) { + update(item, updateParams = null) { const idx = this.indexOf(item); if (idx !== -1) { this._items[idx] = item; - this.emitUpdate(idx, item, null); + this.emitUpdate(idx, item, updateParams); } }