Skip to content

Commit

Permalink
fixed input prompt not format
Browse files Browse the repository at this point in the history
  • Loading branch information
greywen committed Dec 6, 2024
1 parent 220b444 commit 2517ceb
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/FE/components/Chat/ChatInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
};
Expand Down

0 comments on commit 2517ceb

Please sign in to comment.