fix issue#762: upon clicking to resend, the conversation content is cleared.

If there is no subsequent message or if the next message is from the user, this message should be resent. delete the old message after processing is complete.
This commit is contained in:
Linjun 2025-01-18 08:50:34 +08:00 committed by 亢奋猫
parent 8eac836e05
commit e4f4c6cd86

View File

@ -96,9 +96,9 @@ const MessageMenubar: FC<Props> = (props) => {
})
}
if (!nextMessage) {
onDeleteMessage?.(message)
if (!nextMessage || nextMessage.role === 'user') {
EventEmitter.emit(EVENT_NAMES.SEND_MESSAGE, { ...message, id: uuid() })
onDeleteMessage?.(message)
}
}, [assistantModel?.id, message, model?.id, onDeleteMessage, onGetMessages])