fix(@desktop/chat): Do not allow send empty message
This commit is contained in:
parent
8b3319a1f3
commit
e378cb4fd9
|
@ -342,10 +342,16 @@ Rectangle {
|
|||
|
||||
function onKeyPress(event) {
|
||||
if (event.modifiers === Qt.NoModifier && (event.key === Qt.Key_Enter || event.key === Qt.Key_Return)) {
|
||||
if (getPlainText().trim() === "") {
|
||||
event.accepted = true;
|
||||
return
|
||||
}
|
||||
|
||||
if (checkTextInsert()) {
|
||||
event.accepted = true;
|
||||
return
|
||||
}
|
||||
|
||||
if (messageInputField.length <= messageLimit) {
|
||||
control.sendMessage(event)
|
||||
control.hideExtendedArea();
|
||||
|
|
Loading…
Reference in New Issue