feat: Create a conversation before uploading files in it #1880 (#2057)

### What problem does this PR solve?

feat: Create a conversation before uploading files in it #1880

### Type of change


- [x] New Feature (non-breaking change which adds functionality)
This commit is contained in:
balibabu
2024-08-22 18:01:48 +08:00
committed by GitHub
parent 35e880c432
commit c739b68b29
9 changed files with 175 additions and 21 deletions

View File

@ -4,6 +4,7 @@ import { MessageType } from '@/constants/chat';
import { Drawer, Flex, Spin } from 'antd';
import {
useClickDrawer,
useCreateConversationBeforeUploadDocument,
useFetchConversationOnMount,
useGetFileIcon,
useGetSendButtonDisabled,
@ -24,6 +25,7 @@ const ChatContainer = () => {
addNewestConversation,
removeLatestMessage,
addNewestAnswer,
conversationId,
} = useFetchConversationOnMount();
const {
handleInputChange,
@ -43,6 +45,8 @@ const ChatContainer = () => {
useGetFileIcon();
const loading = useSelectConversationLoading();
const { data: userInfo } = useFetchUserInfo();
const { createConversationBeforeUploadDocument } =
useCreateConversationBeforeUploadDocument();
return (
<>
@ -78,7 +82,10 @@ const ChatContainer = () => {
value={value}
onInputChange={handleInputChange}
onPressEnter={handlePressEnter}
conversationId={conversation.id}
conversationId={conversationId}
createConversationBeforeUploadDocument={
createConversationBeforeUploadDocument
}
></MessageInput>
</Flex>
<Drawer