From 0b0e57597d5d72b47d0ea02dd0f00c02c905b712 Mon Sep 17 00:00:00 2001
From: ialokim <ialokim@mailbox.org>
Date: Sat, 13 Nov 2021 18:57:14 +0100
Subject: [PATCH] don't clear blank messages that are not send

---
 .../briar/desktop/conversation/ConversationViewModel.kt        | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/main/kotlin/org/briarproject/briar/desktop/conversation/ConversationViewModel.kt b/src/main/kotlin/org/briarproject/briar/desktop/conversation/ConversationViewModel.kt
index 235306c150..a1c864d201 100644
--- a/src/main/kotlin/org/briarproject/briar/desktop/conversation/ConversationViewModel.kt
+++ b/src/main/kotlin/org/briarproject/briar/desktop/conversation/ConversationViewModel.kt
@@ -83,11 +83,12 @@ constructor(
     fun sendMessage() {
         try {
             val text = _newMessage.value
-            _newMessage.value = ""
 
             // don't send empty or blank messages
             if (text.isBlank()) return
 
+            _newMessage.value = ""
+
             val start = LogUtils.now()
             val m = createMessage(text)
             messagingManager.addLocalMessage(m)
-- 
GitLab