From 73e41b0de03609e8ed1d5f60f27227a589e63909 Mon Sep 17 00:00:00 2001 From: jialin Date: Mon, 13 Jan 2025 15:58:36 +0800 Subject: [PATCH] fix: update page number of new logs --- src/components/logs-viewer/virtual-log-list.tsx | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/components/logs-viewer/virtual-log-list.tsx b/src/components/logs-viewer/virtual-log-list.tsx index 6ed8c228..31bf80da 100644 --- a/src/components/logs-viewer/virtual-log-list.tsx +++ b/src/components/logs-viewer/virtual-log-list.tsx @@ -262,9 +262,7 @@ const LogsViewer: React.FC = forwardRef((props, ref) => { if (isLoadingMoreRef.current) { pageRef.current = totalPageRef.current; - } - - if ( + } else if ( pageRef.current === oldTotalPage && scrollPosRef.current.pos === 'bottom' ) { @@ -279,7 +277,7 @@ const LogsViewer: React.FC = forwardRef((props, ref) => { const start = (pageRef.current - 1) * pageSize; const end = pageRef.current * pageSize; const currentLogs = result.slice(start, end); - console.log('result+++++++', result); + setLogs(result); setTotalPage(totalPageRef.current); setPage(pageRef.current);