mirror of
https://github.com/vector-im/hydrogen-web.git
synced 2024-12-23 11:35:04 +01:00
rename SortedArray.replace to update
This commit is contained in:
parent
d8d97c40f7
commit
f976eeaf13
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user