From 1c043b842667b30014c4380106ebc5282f87653e Mon Sep 17 00:00:00 2001 From: Vico Chu <30412827+vicoooo26@users.noreply.github.com> Date: Tue, 6 Aug 2024 13:33:21 +0800 Subject: [PATCH] Chores: fix name typo (#6987) --- web/app/components/base/chat/chat/hooks.ts | 18 +++++++++--------- .../workflow/panel/debug-and-preview/hooks.ts | 10 +++++----- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/web/app/components/base/chat/chat/hooks.ts b/web/app/components/base/chat/chat/hooks.ts index 4f012ece2a..a70b1c2ed0 100644 --- a/web/app/components/base/chat/chat/hooks.ts +++ b/web/app/components/base/chat/chat/hooks.ts @@ -83,7 +83,7 @@ export const useChat = ( const { t } = useTranslation() const { formatTime } = useTimestamp() const { notify } = useToastContext() - const connversationId = useRef('') + const conversationId = useRef('') const hasStopResponded = useRef(false) const [isResponding, setIsResponding] = useState(false) const isRespondingRef = useRef(false) @@ -152,7 +152,7 @@ export const useChat = ( }, [stopChat, handleResponding]) const handleRestart = useCallback(() => { - connversationId.current = '' + conversationId.current = '' taskIdRef.current = '' handleStop() const newChatList = config?.opening_statement @@ -248,7 +248,7 @@ export const useChat = ( const bodyParams = { response_mode: 'streaming', - conversation_id: connversationId.current, + conversation_id: conversationId.current, ...data, } if (bodyParams?.files?.length) { @@ -302,7 +302,7 @@ export const useChat = ( } if (isFirstMessage && newConversationId) - connversationId.current = newConversationId + conversationId.current = newConversationId taskIdRef.current = taskId if (messageId) @@ -322,11 +322,11 @@ export const useChat = ( return if (onConversationComplete) - onConversationComplete(connversationId.current) + onConversationComplete(conversationId.current) - if (connversationId.current && !hasStopResponded.current && onGetConvesationMessages) { + if (conversationId.current && !hasStopResponded.current && onGetConvesationMessages) { const { data }: any = await onGetConvesationMessages( - connversationId.current, + conversationId.current, newAbortController => conversationMessagesAbortControllerRef.current = newAbortController, ) const newResponseItem = data.find((item: any) => item.id === responseItem.id) @@ -361,7 +361,7 @@ export const useChat = ( latency: newResponseItem.provider_response_latency.toFixed(2), }, // for agent log - conversationId: connversationId.current, + conversationId: conversationId.current, input: { inputs: newResponseItem.inputs, query: newResponseItem.query, @@ -640,7 +640,7 @@ export const useChat = ( return { chatList, setChatList, - conversationId: connversationId.current, + conversationId: conversationId.current, isResponding, setIsResponding, handleSend, diff --git a/web/app/components/workflow/panel/debug-and-preview/hooks.ts b/web/app/components/workflow/panel/debug-and-preview/hooks.ts index d7f6ee4828..155d2a84ac 100644 --- a/web/app/components/workflow/panel/debug-and-preview/hooks.ts +++ b/web/app/components/workflow/panel/debug-and-preview/hooks.ts @@ -35,7 +35,7 @@ export const useChat = ( const { notify } = useToastContext() const { handleRun } = useWorkflowRun() const hasStopResponded = useRef(false) - const connversationId = useRef('') + const conversationId = useRef('') const taskIdRef = useRef('') const [chatList, setChatList] = useState(prevChatList || []) const chatListRef = useRef(prevChatList || []) @@ -100,7 +100,7 @@ export const useChat = ( }, [handleResponding, stopChat]) const handleRestart = useCallback(() => { - connversationId.current = '' + conversationId.current = '' taskIdRef.current = '' handleStop() const newChatList = config?.opening_statement @@ -185,7 +185,7 @@ export const useChat = ( handleResponding(true) const bodyParams = { - conversation_id: connversationId.current, + conversation_id: conversationId.current, ...params, } if (bodyParams?.files?.length) { @@ -214,7 +214,7 @@ export const useChat = ( } if (isFirstMessage && newConversationId) - connversationId.current = newConversationId + conversationId.current = newConversationId taskIdRef.current = taskId if (messageId) @@ -403,7 +403,7 @@ export const useChat = ( }, [handleRun, handleResponding, handleUpdateChatList, notify, t, updateCurrentQA, config.suggested_questions_after_answer?.enabled]) return { - conversationId: connversationId.current, + conversationId: conversationId.current, chatList, handleSend, handleStop,