mirror of
https://github.com/infiniflow/ragflow.git
synced 2026-06-29 23:41:12 +08:00
Fix: Switching pagesize on a chunk page did not reset the current page. (#15401)
### What problem does this PR solve? Fix: Switching pagesize on a chunk page did not reset the current page. ### Type of change - [x] Bug Fix (non-breaking change which fixes an issue)
This commit is contained in:
@@ -49,16 +49,21 @@ export function useHandleFilterSubmit() {
|
||||
);
|
||||
|
||||
const checkValue = useCallback((filters: FilterCollection[]) => {
|
||||
if (!filters?.length || !filterValue) {
|
||||
if (!filters?.length) {
|
||||
return;
|
||||
}
|
||||
|
||||
const validFields = filters.reduce((pre, cur) => {
|
||||
return [...pre, ...getFilterIds(cur as FilterType)];
|
||||
}, [] as string[]);
|
||||
|
||||
if (!validFields.length) {
|
||||
return;
|
||||
}
|
||||
|
||||
setFilterValue((preValue) => {
|
||||
if (!preValue) return preValue;
|
||||
|
||||
const newValue: FilterValue = mergeFilterValue(preValue, validFields);
|
||||
return newValue;
|
||||
});
|
||||
|
||||
@@ -72,10 +72,14 @@ export const useGetPaginationWithRouter = () => {
|
||||
} = useSetPaginationParams();
|
||||
|
||||
const onPageChange: Pagination['onChange'] = useCallback(
|
||||
(pageNumber: number, pageSize?: number) => {
|
||||
setPaginationParams(pageNumber, pageSize);
|
||||
(pageNumber: number, size?: number) => {
|
||||
if (size !== pageSize) {
|
||||
setPaginationParams(1, size);
|
||||
} else {
|
||||
setPaginationParams(pageNumber, size);
|
||||
}
|
||||
},
|
||||
[setPaginationParams],
|
||||
[setPaginationParams, pageSize],
|
||||
);
|
||||
|
||||
const setCurrentPagination = useCallback(
|
||||
|
||||
@@ -10,7 +10,7 @@ import {
|
||||
} from '@/components/ui/card';
|
||||
|
||||
import WhatIsThis from '@/components/what-is-this';
|
||||
import { RunningStatusMap } from '@/constants/knowledge';
|
||||
import { RunningStatusMap, RunningStatusOld } from '@/constants/knowledge';
|
||||
import { useFetchDocumentList } from '@/hooks/use-document-request';
|
||||
import { FC, useEffect, useMemo, useState } from 'react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
@@ -185,7 +185,7 @@ const FileLogsPage: FC = () => {
|
||||
{
|
||||
field: 'operation_status',
|
||||
label: t('knowledgeDetails.status'),
|
||||
list: Object.values(RunningStatus).map((value) => {
|
||||
list: Object.values(RunningStatusOld).map((value) => {
|
||||
// const value = key as RunningStatus;
|
||||
return {
|
||||
id: value,
|
||||
|
||||
Reference in New Issue
Block a user