mirror of
https://github.com/infiniflow/ragflow.git
synced 2025-12-08 20:42:30 +08:00
feat: let the messages I send appear immediately in the chat window and remove rewrite configuration from nginx proxy (#86)
* feat: remove rewrite configuration from nginx proxy * feat: let the messages I send appear immediately in the chat window
This commit is contained in:
@ -10,10 +10,8 @@ import reactStringReplace from 'react-string-replace';
|
||||
import {
|
||||
useFetchConversationOnMount,
|
||||
useGetFileIcon,
|
||||
useScrollToBottom,
|
||||
useSendMessage,
|
||||
} from '../hooks';
|
||||
import { IClientConversation } from '../interface';
|
||||
|
||||
import Image from '@/components/image';
|
||||
import NewDocumentLink from '@/components/new-document-link';
|
||||
@ -187,17 +185,24 @@ const MessageItem = ({
|
||||
|
||||
const ChatContainer = () => {
|
||||
const [value, setValue] = useState('');
|
||||
const conversation: IClientConversation = useFetchConversationOnMount();
|
||||
const {
|
||||
ref,
|
||||
currentConversation: conversation,
|
||||
addNewestConversation,
|
||||
} = useFetchConversationOnMount();
|
||||
const { sendMessage } = useSendMessage();
|
||||
|
||||
const loading = useOneNamespaceEffectsLoading('chatModel', [
|
||||
'completeConversation',
|
||||
]);
|
||||
const ref = useScrollToBottom();
|
||||
useGetFileIcon();
|
||||
|
||||
const handlePressEnter = () => {
|
||||
setValue('');
|
||||
sendMessage(value);
|
||||
if (!loading) {
|
||||
setValue('');
|
||||
addNewestConversation(value);
|
||||
sendMessage(value);
|
||||
}
|
||||
};
|
||||
|
||||
const handleInputChange: ChangeEventHandler<HTMLInputElement> = (e) => {
|
||||
|
||||
Reference in New Issue
Block a user