From f7eeb4d1e3050c1524fba46cede8cd2faf9b6f38 Mon Sep 17 00:00:00 2001 From: JRoberts <8711996+jr-simplex@users.noreply.github.com> Date: Mon, 23 May 2022 13:44:49 +0400 Subject: [PATCH] android: fix compose view clearing state prematurely (#689) --- .../src/main/java/chat/simplex/app/views/chat/ComposeView.kt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/apps/android/app/src/main/java/chat/simplex/app/views/chat/ComposeView.kt b/apps/android/app/src/main/java/chat/simplex/app/views/chat/ComposeView.kt index aa0f6c4085..bd87d253de 100644 --- a/apps/android/app/src/main/java/chat/simplex/app/views/chat/ComposeView.kt +++ b/apps/android/app/src/main/java/chat/simplex/app/views/chat/ComposeView.kt @@ -326,6 +326,7 @@ fun ComposeView( mc = updateMsgContent(oldMsgContent) ) if (updatedItem != null) chatModel.upsertChatItem(cInfo, updatedItem.chatItem) + clearState() } } } @@ -369,11 +370,13 @@ fun ComposeView( mc = mc ) if (aChatItem != null) chatModel.addChatItem(cInfo, aChatItem.chatItem) + clearState() } + } else { + clearState() } } } - clearState() } fun onMessageChange(s: String) {