mirror of
https://github.com/infiniflow/ragflow.git
synced 2026-02-05 01:55:05 +08:00
### What problem does this PR solve? Feat: Users can chat directly without first creating a conversation. #11768 ### Type of change - [x] New Feature (non-breaking change which adds functionality)
This commit is contained in:
@ -1,9 +1,9 @@
|
||||
import { useClickConversationCard } from '@/hooks/use-chat-request';
|
||||
import { useCallback, useState } from 'react';
|
||||
import { useChatUrlParams } from './use-chat-url';
|
||||
|
||||
export function useHandleClickConversationCard() {
|
||||
const [controller, setController] = useState(new AbortController());
|
||||
const { handleClickConversation } = useClickConversationCard();
|
||||
const { setConversationBoth } = useChatUrlParams();
|
||||
|
||||
const stopOutputMessage = useCallback(() => {
|
||||
setController((pre) => {
|
||||
@ -14,10 +14,10 @@ export function useHandleClickConversationCard() {
|
||||
|
||||
const handleConversationCardClick = useCallback(
|
||||
(conversationId: string, isNew: boolean) => {
|
||||
handleClickConversation(conversationId, isNew ? 'true' : '');
|
||||
setConversationBoth(conversationId, isNew ? 'true' : '');
|
||||
stopOutputMessage();
|
||||
},
|
||||
[handleClickConversation, stopOutputMessage],
|
||||
[setConversationBoth, stopOutputMessage],
|
||||
);
|
||||
|
||||
return { controller, handleConversationCardClick, stopOutputMessage };
|
||||
|
||||
Reference in New Issue
Block a user