mirror of
https://github.com/infiniflow/ragflow.git
synced 2025-12-19 12:06:42 +08:00
feat: jumping from the chunk list page to the file list page keeps th… (#174)
* feat: jumping from the chunk list page to the file list page keeps the original page number. * feat: jump to the file upload page and reset the file list page number to 1
This commit is contained in:
@ -1,5 +1,6 @@
|
||||
import { KnowledgeSearchParams } from '@/constants/knowledge';
|
||||
import { useLocation, useSearchParams } from 'umi';
|
||||
import { useCallback } from 'react';
|
||||
import { useLocation, useNavigate, useSearchParams } from 'umi';
|
||||
|
||||
export enum SegmentIndex {
|
||||
Second = '2',
|
||||
@ -31,3 +32,13 @@ export const useGetKnowledgeSearchParams = () => {
|
||||
currentQueryParameters.get(KnowledgeSearchParams.KnowledgeId) || '',
|
||||
};
|
||||
};
|
||||
|
||||
export const useNavigateWithFromState = () => {
|
||||
const navigate = useNavigate();
|
||||
return useCallback(
|
||||
(path: string) => {
|
||||
navigate(path, { state: { from: path } });
|
||||
},
|
||||
[navigate],
|
||||
);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user