From 2517ceba52c1ad6390bb714e0735b3b9138ad2f1 Mon Sep 17 00:00:00 2001 From: gray Date: Fri, 6 Dec 2024 11:19:54 +0800 Subject: [PATCH] fixed input prompt not format --- src/FE/components/Chat/ChatInput.tsx | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/FE/components/Chat/ChatInput.tsx b/src/FE/components/Chat/ChatInput.tsx index 6e3c86c7..c6c3aaa7 100644 --- a/src/FE/components/Chat/ChatInput.tsx +++ b/src/FE/components/Chat/ChatInput.tsx @@ -181,10 +181,13 @@ export const ChatInput = ({ if (parsedVariables.length > 0) { setIsModalVisible(true); } else { - setContent((prevContent) => { - const updatedContent = prevContent.text?.replace(/\/\w*$/, formatted); - return { ...prevContent, text: updatedContent }; + const text = content.text?.replace(/\/\w*$/, formatted); + + setContent({ + ...content, + text, }); + updatePromptListVisibility(formatted); } };