fix: disable sending messages if both application and conversation are empty and add loading to all pages (#134)

* feat: add loading to all pages

* fix: disable sending messages if both application and conversation are empty

* feat: add chatSpin class to Spin of chat
This commit is contained in:
balibabu
2024-03-20 11:13:51 +08:00
committed by GitHub
parent d38e92aac8
commit 78727c8809
24 changed files with 629 additions and 473 deletions

View File

@@ -0,0 +1,24 @@
import { useCallback } from 'react';
import { useDispatch } from 'umi';
import { useGetKnowledgeSearchParams } from './routeHook';
interface PayloadType {
doc_id: string;
keywords?: string;
}
export const useFetchChunkList = () => {
const dispatch = useDispatch();
const { documentId } = useGetKnowledgeSearchParams();
const fetchChunkList = useCallback(() => {
dispatch({
type: 'chunkModel/chunk_list',
payload: {
doc_id: documentId,
},
});
}, [dispatch, documentId]);
return fetchChunkList;
};