diff --git a/src/components/logs-viewer/virtual-log-list.tsx b/src/components/logs-viewer/virtual-log-list.tsx index 8ffa9583..385670af 100644 --- a/src/components/logs-viewer/virtual-log-list.tsx +++ b/src/components/logs-viewer/virtual-log-list.tsx @@ -50,7 +50,6 @@ const LogsViewer: React.FC = forwardRef((props, ref) => { pos: 'bottom', page: 1 }); - const dataLengthRef = useRef(0); const lineCountRef = useRef(0); useImperativeHandle(ref, () => ({ @@ -251,7 +250,12 @@ const LogsViewer: React.FC = forwardRef((props, ref) => { ); setLogs(result); setTotalPage(totalPageRef.current); - setPage(pageRef.current); + if (isLoadingMoreRef.current) { + setPage(totalPageRef.current); + pageRef.current = totalPageRef.current; + } else { + setPage(pageRef.current); + } setCurrentData(currentLogs); debounceLoading(); };