From 9bf5c1adf20c7defe90f0f1aaf34a17897c9aea5 Mon Sep 17 00:00:00 2001 From: Tobias Fella Date: Sun, 27 Nov 2022 17:25:56 +0100 Subject: [PATCH] Don't clear chatbox text when starting a reply --- src/neochatroom.cpp | 6 ++++++ src/qml/Component/ChatBox/ChatBar.qml | 4 +++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/neochatroom.cpp b/src/neochatroom.cpp index 670b204ab..eb44050c8 100644 --- a/src/neochatroom.cpp +++ b/src/neochatroom.cpp @@ -1209,6 +1209,9 @@ QString NeoChatRoom::chatBoxReplyId() const void NeoChatRoom::setChatBoxReplyId(const QString &replyId) { + if (replyId == m_chatBoxReplyId) { + return; + } m_chatBoxReplyId = replyId; Q_EMIT chatBoxReplyIdChanged(); } @@ -1220,6 +1223,9 @@ QString NeoChatRoom::chatBoxEditId() const void NeoChatRoom::setChatBoxEditId(const QString &editId) { + if (editId == m_chatBoxEditId) { + return; + } m_chatBoxEditId = editId; Q_EMIT chatBoxEditIdChanged(); } diff --git a/src/qml/Component/ChatBox/ChatBar.qml b/src/qml/Component/ChatBox/ChatBar.qml index eaf1cfa48..2c9ddac04 100644 --- a/src/qml/Component/ChatBox/ChatBar.qml +++ b/src/qml/Component/ChatBox/ChatBar.qml @@ -239,7 +239,9 @@ QQC2.ToolBar { Connections { target: currentRoom function onChatBoxEditIdChanged() { - chatBar.inputFieldText = currentRoom.chatBoxEditMessage + if (currentRoom.chatBoxEditMessage.length > 0) { + chatBar.inputFieldText = currentRoom.chatBoxEditMessage + } } }