chat: do not allow sending a message while the LLM is responding (#2323)

Signed-off-by: Jared Van Bortel <jared@nomic.ai>
This commit is contained in:
Jared Van Bortel 2024-05-09 09:37:36 -04:00 committed by GitHub
parent d54e644d05
commit f26e8d0d87
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1416,11 +1416,11 @@ Rectangle {
Accessible.role: Accessible.EditableText
Accessible.name: placeholderText
Accessible.description: qsTr("Send messages/prompts to the model")
Keys.onReturnPressed: (event)=> {
if (event.modifiers & Qt.ControlModifier || event.modifiers & Qt.ShiftModifier)
event.accepted = false;
else {
editingFinished();
Keys.onReturnPressed: (event) => {
if (event.modifiers & Qt.ControlModifier || event.modifiers & Qt.ShiftModifier) {
event.accepted = false
} else if (!currentChat.responseInProgress) {
editingFinished()
sendMessage()
}
}
@ -1494,6 +1494,7 @@ Rectangle {
width: 30
height: 30
visible: !currentChat.isServer
enabled: !currentChat.responseInProgress
source: "qrc:/gpt4all/icons/send_message.svg"
Accessible.name: qsTr("Send message")
Accessible.description: qsTr("Sends the message/prompt contained in textfield to the model")