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