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) {
|
function onKeyPress(event) {
|
||||||
if (event.modifiers === Qt.NoModifier && (event.key === Qt.Key_Enter || event.key === Qt.Key_Return)) {
|
if (event.modifiers === Qt.NoModifier && (event.key === Qt.Key_Enter || event.key === Qt.Key_Return)) {
|
||||||
|
if (getPlainText().trim() === "") {
|
||||||
|
event.accepted = true;
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
if (checkTextInsert()) {
|
if (checkTextInsert()) {
|
||||||
event.accepted = true;
|
event.accepted = true;
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
if (messageInputField.length <= messageLimit) {
|
if (messageInputField.length <= messageLimit) {
|
||||||
control.sendMessage(event)
|
control.sendMessage(event)
|
||||||
control.hideExtendedArea();
|
control.hideExtendedArea();
|
||||||
|
|
Loading…
Reference in New Issue