fix: set last page after loading all logs
This commit is contained in:
@@ -50,7 +50,6 @@ const LogsViewer: React.FC<LogsViewerProps> = forwardRef((props, ref) => {
|
|||||||
pos: 'bottom',
|
pos: 'bottom',
|
||||||
page: 1
|
page: 1
|
||||||
});
|
});
|
||||||
const dataLengthRef = useRef(0);
|
|
||||||
const lineCountRef = useRef(0);
|
const lineCountRef = useRef(0);
|
||||||
|
|
||||||
useImperativeHandle(ref, () => ({
|
useImperativeHandle(ref, () => ({
|
||||||
@@ -251,7 +250,12 @@ const LogsViewer: React.FC<LogsViewerProps> = forwardRef((props, ref) => {
|
|||||||
);
|
);
|
||||||
setLogs(result);
|
setLogs(result);
|
||||||
setTotalPage(totalPageRef.current);
|
setTotalPage(totalPageRef.current);
|
||||||
setPage(pageRef.current);
|
if (isLoadingMoreRef.current) {
|
||||||
|
setPage(totalPageRef.current);
|
||||||
|
pageRef.current = totalPageRef.current;
|
||||||
|
} else {
|
||||||
|
setPage(pageRef.current);
|
||||||
|
}
|
||||||
setCurrentData(currentLogs);
|
setCurrentData(currentLogs);
|
||||||
debounceLoading();
|
debounceLoading();
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user