From e378cb4fd94110fd52aac2d096e4b9260346ce91 Mon Sep 17 00:00:00 2001 From: mprakhov Date: Wed, 21 Dec 2022 23:23:35 +0200 Subject: [PATCH] fix(@desktop/chat): Do not allow send empty message --- ui/imports/shared/status/StatusChatInput.qml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/ui/imports/shared/status/StatusChatInput.qml b/ui/imports/shared/status/StatusChatInput.qml index 18acccc416..2c460af887 100644 --- a/ui/imports/shared/status/StatusChatInput.qml +++ b/ui/imports/shared/status/StatusChatInput.qml @@ -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();