mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-05-02 02:03:58 +00:00
fixed potencial problem
This commit is contained in:
@@ -211,6 +211,7 @@ export default function DataGridCore(props) {
|
|||||||
allRowCount: null,
|
allRowCount: null,
|
||||||
errorMessage: null,
|
errorMessage: null,
|
||||||
jslStatsCounter: 0,
|
jslStatsCounter: 0,
|
||||||
|
jslChangeIndex: 0,
|
||||||
});
|
});
|
||||||
const { isLoading, loadedRows, isLoadedAll, loadedTime, allRowCount, errorMessage } = loadProps;
|
const { isLoading, loadedRows, isLoadedAll, loadedTime, allRowCount, errorMessage } = loadProps;
|
||||||
|
|
||||||
@@ -381,6 +382,7 @@ export default function DataGridCore(props) {
|
|||||||
loadedTime: new Date().getTime(),
|
loadedTime: new Date().getTime(),
|
||||||
errorMessage: null,
|
errorMessage: null,
|
||||||
jslStatsCounter: 0,
|
jslStatsCounter: 0,
|
||||||
|
jslChangeIndex: 0,
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -421,11 +423,13 @@ export default function DataGridCore(props) {
|
|||||||
}, [columnSizes, gridScrollAreaWidth]);
|
}, [columnSizes, gridScrollAreaWidth]);
|
||||||
|
|
||||||
const handleJslDataStats = React.useCallback((stats) => {
|
const handleJslDataStats = React.useCallback((stats) => {
|
||||||
|
if (stats.changeIndex < loadProps.jslChangeIndex) return;
|
||||||
setLoadProps((oldProps) => ({
|
setLoadProps((oldProps) => ({
|
||||||
...oldProps,
|
...oldProps,
|
||||||
allRowCount: stats.rowCount,
|
allRowCount: stats.rowCount,
|
||||||
isLoadedAll: false,
|
isLoadedAll: false,
|
||||||
jslStatsCounter: oldProps.jslStatsCounter + 1,
|
jslStatsCounter: oldProps.jslStatsCounter + 1,
|
||||||
|
jslChangeIndex: stats.changeIndex,
|
||||||
}));
|
}));
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user