Fix the send message only when enter has been pressed or the send icon has been clicked.

This commit is contained in:
Adam Treat 2023-04-25 12:13:17 -04:00
parent cf8a4dd868
commit b8b254cd9c

View File

@ -875,10 +875,12 @@ Window {
Keys.onReturnPressed: (event)=> {
if (event.modifiers & Qt.ControlModifier || event.modifiers & Qt.ShiftModifier)
event.accepted = false;
else
else {
editingFinished();
sendMessage()
}
onEditingFinished: {
}
function sendMessage() {
if (textInput.text === "")
return
@ -926,7 +928,7 @@ Window {
Accessible.description: qsTr("Sends the message/prompt contained in textfield to the model")
onClicked: {
textInput.accepted()
textInput.sendMessage()
}
}
}