fix: update page number of new logs
This commit is contained in:
@@ -262,9 +262,7 @@ const LogsViewer: React.FC<LogsViewerProps> = forwardRef((props, ref) => {
|
|||||||
|
|
||||||
if (isLoadingMoreRef.current) {
|
if (isLoadingMoreRef.current) {
|
||||||
pageRef.current = totalPageRef.current;
|
pageRef.current = totalPageRef.current;
|
||||||
}
|
} else if (
|
||||||
|
|
||||||
if (
|
|
||||||
pageRef.current === oldTotalPage &&
|
pageRef.current === oldTotalPage &&
|
||||||
scrollPosRef.current.pos === 'bottom'
|
scrollPosRef.current.pos === 'bottom'
|
||||||
) {
|
) {
|
||||||
@@ -279,7 +277,7 @@ const LogsViewer: React.FC<LogsViewerProps> = forwardRef((props, ref) => {
|
|||||||
const start = (pageRef.current - 1) * pageSize;
|
const start = (pageRef.current - 1) * pageSize;
|
||||||
const end = pageRef.current * pageSize;
|
const end = pageRef.current * pageSize;
|
||||||
const currentLogs = result.slice(start, end);
|
const currentLogs = result.slice(start, end);
|
||||||
console.log('result+++++++', result);
|
|
||||||
setLogs(result);
|
setLogs(result);
|
||||||
setTotalPage(totalPageRef.current);
|
setTotalPage(totalPageRef.current);
|
||||||
setPage(pageRef.current);
|
setPage(pageRef.current);
|
||||||
|
|||||||
Reference in New Issue
Block a user