mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-17 23:45:59 +00:00
perspectives: prevent multi-load
This commit is contained in:
@@ -57,6 +57,7 @@
|
||||
let errorMessage;
|
||||
let rowCount;
|
||||
let isLoading = false;
|
||||
let isLoadQueued = false;
|
||||
const lastVisibleRowIndexRef = createRef(0);
|
||||
const disableLoadNextRef = createRef(false);
|
||||
|
||||
@@ -121,6 +122,12 @@
|
||||
}
|
||||
|
||||
async function loadData(node: PerspectiveTreeNode, counts) {
|
||||
if (isLoading) {
|
||||
isLoadQueued = true;
|
||||
return;
|
||||
} else {
|
||||
isLoadQueued = false;
|
||||
}
|
||||
// console.log('LOADING', node);
|
||||
if (!node) return;
|
||||
const rows = [];
|
||||
@@ -147,6 +154,10 @@
|
||||
// loadProps.push(child.getNodeLoadProps());
|
||||
// }
|
||||
// }
|
||||
|
||||
if (isLoadQueued) {
|
||||
loadData(root, $loadedCounts);
|
||||
}
|
||||
}
|
||||
|
||||
export function openJson() {
|
||||
|
||||
Reference in New Issue
Block a user