From 8b48a3991eac809875afedbfa2c440bd21fc1552 Mon Sep 17 00:00:00 2001
From: wujingjing <gersonwu@qq.com>
Date: 星期一, 19 八月 2024 15:23:22 +0800
Subject: [PATCH] 测试 pre_question

---
 src/components/chat/hooks/useAssistantContentOpt.ts |   12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/src/components/chat/hooks/useAssistantContentOpt.ts b/src/components/chat/hooks/useAssistantContentOpt.ts
index 6141114..50dd174 100644
--- a/src/components/chat/hooks/useAssistantContentOpt.ts
+++ b/src/components/chat/hooks/useAssistantContentOpt.ts
@@ -16,7 +16,7 @@
 export const useAssistantContentOpt = (option: AssistantContentOptOption) => {
 	const { forbidScroll, sendChatMessage, displayMessageList } = option;
 	const { toClipboard } = useClipboard();
-	const isNextChat = ref(false);
+	const preQuestion = ref(null);
 
 	const copyClick = (item) => {
 		const type = item.content.type;
@@ -80,7 +80,7 @@
 		});
 	};
 	useClickOther(
-		computed(() => feedbackPanelRef.value[curFeedbackIndex.value]),
+		computed(() => feedbackPanelRef.value?.[curFeedbackIndex.value]),
 		feedbackIsShow,
 		() => {
 			feedbackIsShow.value = false;
@@ -103,16 +103,16 @@
 		sendChatMessage({ type: AnswerType.Text, values: item.question });
 	};
 
-	const fixQuestionClick = (item) => {
+	const fixQuestionClick = (item,originData) => {
 		if (!item.question) return;
-		isNextChat.value = true;
+		preQuestion.value = originData?.question;
 		try {
 			sendChatMessage({
 				type: AnswerType.Text,
 				values: item.question,
 			});
 		} finally {
-			isNextChat.value = false;
+			preQuestion.value = null;
 		}
 	};
 
@@ -129,7 +129,7 @@
 		feedbackClick,
 		askMoreClick,
 		fixQuestionClick,
-		isNextChat,
+		preQuestion,
 		showAskMore,
 		showFixQuestion,
 	};

--
Gitblit v1.9.3