From dfb569c0f6d900e2befc2580d8836ed33981d514 Mon Sep 17 00:00:00 2001 From: Akseli Lahtinen Date: Sun, 27 Nov 2022 20:44:41 +0000 Subject: [PATCH] Possible typing notification fixes I've made few possible fixes for the typing notification getting stuck for long periods of time. I could use some help testing these to see if they help others too. For me the typing notification doesn't linger around that long after these changes. --- src/qml/Component/ChatBox/ChatBar.qml | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/qml/Component/ChatBox/ChatBar.qml b/src/qml/Component/ChatBox/ChatBar.qml index 2c9ddac04..4cfa2eee5 100644 --- a/src/qml/Component/ChatBox/ChatBar.qml +++ b/src/qml/Component/ChatBox/ChatBar.qml @@ -137,6 +137,9 @@ QQC2.ToolBar { completionMenu.decrementIndex() } else if (event.key === Qt.Key_Down && completionMenu.visible) { completionMenu.incrementIndex() + } else if (event.key === Qt.Key_Backspace && inputField.text.length <= 1) { + currentRoom.sendTypingNotification(false) + repeatTimer.stop() } } @@ -147,10 +150,10 @@ QQC2.ToolBar { onTextChanged: { if (!repeatTimer.running && Config.typingNotifications) { - currentRoom.sendTypingNotification(true) + var textExists = text.length > 0 + currentRoom.sendTypingNotification(textExists) + textExists ? repeatTimer.start() : repeatTimer.stop() } - repeatTimer.start() - currentRoom.chatBoxText = text } } @@ -267,7 +270,7 @@ QQC2.ToolBar { function postMessage() { actionsHandler.handleMessage(); - + repeatTimer.stop() currentRoom.markAllMessagesAsRead(); inputField.clear(); currentRoom.chatBoxReplyId = "";