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:
+9
-10
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user