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"} : "string message"}
</Button> </Button>
)} )}
<Button onClick={() => setShowEdit(false)}>Save & Close</Button> <Button onClick={() => setShowEdit(false)}>Close</Button>
</DialogContent> </DialogContent>
</Dialog> </Dialog>
); );

View File

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