mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-23 02:16:02 +00:00
fix - prevented double load
This commit is contained in:
@@ -214,19 +214,19 @@ export default function DataGridCore(props) {
|
|||||||
|
|
||||||
const handleLoadRowCount = async () => {
|
const handleLoadRowCount = async () => {
|
||||||
const rowCount = await loadRowCount(props);
|
const rowCount = await loadRowCount(props);
|
||||||
setLoadProps({
|
setLoadProps((oldLoadProps) => ({
|
||||||
...loadProps,
|
...oldLoadProps,
|
||||||
allRowCount: rowCount,
|
allRowCount: rowCount,
|
||||||
});
|
}));
|
||||||
};
|
};
|
||||||
|
|
||||||
const loadNextData = async () => {
|
const loadNextData = async () => {
|
||||||
if (isLoading) return;
|
if (isLoading) return;
|
||||||
setLoadProps({
|
setLoadProps((oldLoadProps) => ({
|
||||||
...loadProps,
|
...oldLoadProps,
|
||||||
isLoading: true,
|
isLoading: true,
|
||||||
allRowCount: null,
|
allRowCount: null,
|
||||||
});
|
}));
|
||||||
const loadStart = new Date().getTime();
|
const loadStart = new Date().getTime();
|
||||||
loadedTimeRef.current = loadStart;
|
loadedTimeRef.current = loadStart;
|
||||||
|
|
||||||
@@ -246,11 +246,11 @@ export default function DataGridCore(props) {
|
|||||||
loadedTime,
|
loadedTime,
|
||||||
isLoadedAll: nextRows.length === 0,
|
isLoadedAll: nextRows.length === 0,
|
||||||
};
|
};
|
||||||
setLoadProps({
|
setLoadProps((oldLoadProps) => ({
|
||||||
...loadProps,
|
...oldLoadProps,
|
||||||
isLoading: false,
|
isLoading: false,
|
||||||
...loadedInfo,
|
...loadedInfo,
|
||||||
});
|
}));
|
||||||
};
|
};
|
||||||
|
|
||||||
// const data = useFetch({
|
// const data = useFetch({
|
||||||
|
|||||||
Reference in New Issue
Block a user