fix: save edit message on blur

This commit is contained in:
2025-01-08 01:58:41 +08:00
parent 137186e760
commit 394da2217c
2 changed files with 2 additions and 2 deletions

View File

@@ -66,7 +66,7 @@ export function EditMessage(props: EditMessageProps) {
: "string message"}
</Button>
)}
<Button onClick={() => setShowEdit(false)}>Save & Close</Button>
<Button onClick={() => setShowEdit(false)}>Close</Button>
</DialogContent>
</Dialog>
);

View File

@@ -102,7 +102,7 @@ export function EditMessageString({ chat, setShowEdit }: Props) {
<Textarea
className="w-full h-32 my-2"
value={chat.content}
onChange={(event) => {
onBlur={(event) => {
chat.content = event.target.value;
chat.token = calculate_token_length(chat.content);
setChatStore({ ...chatStore });