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
+9 -10
View File
@@ -155,16 +155,15 @@ const tabs: { id: string; url: string; reloader: () => void; unloader?: () => vo
let t: { id: string; url: string; reloader: () => void; unloader?: () => void } = {
id: p.tabName,
url: p.pagePath,
reloader: () =>
p.reload(() => {
if (!navigated && isNavigatable(p)) {
if (p.isURL()) {
navigated = true;
p.navigate();
}
}
if (isPageEventBindable(p)) p.bindPageEvents();
}),
reloader: () => {
if (isPageEventBindable(p)) p.bindPageEvents();
if (!navigated && isNavigatable(p) && p.isURL()) {
navigated = true;
p.navigate();
} else {
p.reload(() => {});
}
},
};
if (isPageEventBindable(p)) t.unloader = p.unbindPageEvents;
tabs.push(t);