list: add load queue

_loadLock set true when a load is happening, if another _load is called
when this is happening, the method call is appended to _loadQueue. When
a running _load finishes, it shift()s the _loadQueue and calls the
method from it if there is one.
This commit is contained in:
Harvey Tindall
2026-01-05 09:51:22 +00:00
parent c10f1e3b36
commit 721b209e1f
4 changed files with 48 additions and 14 deletions
+2
View File
@@ -1106,6 +1106,7 @@ export class accountsList extends PaginatedList implements Navigatable, AsTab {
itemsPerPage: 40,
maxItemsLoadedForSearch: 200,
appendNewItems: (resp: PaginatedDTO) => {
console.log("append");
for (let u of (resp as UsersDTO).users || []) {
if (this.users.has(u.id)) {
this.users.get(u.id).update(u);
@@ -1121,6 +1122,7 @@ export class accountsList extends PaginatedList implements Navigatable, AsTab {
);
},
replaceWithNewItems: (resp: PaginatedDTO) => {
console.log("replace");
let accountsOnDOM = new Map<string, boolean>();
for (let id of this.users.keys()) {