fix: save edit message on blur
This commit is contained in:
@@ -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>
|
||||
);
|
||||
|
||||
@@ -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 });
|
||||
|
||||
Reference in New Issue
Block a user