activities: fix updateExistingElements, rename

forgot to wipe this._ordering, so search was attempting to run on
non-existent items. Also renamed the two functions to appendNewItems and
replaceWithNewItems, this makes more sense to me.
This commit is contained in:
Harvey Tindall
2025-05-23 15:02:42 +01:00
parent d8fe593323
commit 0a7093a3b4
3 changed files with 14 additions and 10 deletions
+2 -2
View File
@@ -925,7 +925,7 @@ export class accountsList extends PaginatedList {
getPageEndpoint: "/users",
itemsPerPage: 40,
maxItemsLoadedForSearch: 200,
newElementsFromPage: (resp: paginatedDTO) => {
appendNewItems: (resp: paginatedDTO) => {
for (let u of ((resp as UsersDTO).users || [])) {
if (u.id in this.users) {
this.users[u.id].update(u);
@@ -940,7 +940,7 @@ export class accountsList extends PaginatedList {
this._search.ascending
);
},
updateExistingElementsFromPage: (resp: paginatedDTO) => {
replaceWithNewItems: (resp: paginatedDTO) => {
let accountsOnDOM: { [id: string]: boolean } = {};
for (let id of Object.keys(this.users)) { accountsOnDOM[id] = true; }