Skip to content

Commit

Permalink
chat: do not allow sending a message while the LLM is responding (#2323)
Browse files Browse the repository at this point in the history
Signed-off-by: Jared Van Bortel <jared@nomic.ai>
  • Loading branch information
cebtenzzre committed May 9, 2024
1 parent d54e644 commit f26e8d0
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions gpt4all-chat/qml/ChatView.qml
Expand Up @@ -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()
}
}
Expand Down Expand Up @@ -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")
Expand Down

0 comments on commit f26e8d0

Please sign in to comment.