diff --git a/presentation/src/main/java/feature/qkreply/QkReplyView.kt b/presentation/src/main/java/feature/qkreply/QkReplyView.kt index d9f9f3d5..ebe565b9 100644 --- a/presentation/src/main/java/feature/qkreply/QkReplyView.kt +++ b/presentation/src/main/java/feature/qkreply/QkReplyView.kt @@ -28,5 +28,6 @@ interface QkReplyView : QkView { val sendIntent: Observable fun setDraft(draft: String) + fun finish() } \ No newline at end of file diff --git a/presentation/src/main/java/feature/qkreply/QkReplyViewModel.kt b/presentation/src/main/java/feature/qkreply/QkReplyViewModel.kt index 50bc9d08..2ebcab99 100644 --- a/presentation/src/main/java/feature/qkreply/QkReplyViewModel.kt +++ b/presentation/src/main/java/feature/qkreply/QkReplyViewModel.kt @@ -72,7 +72,7 @@ class QkReplyViewModel(intent: Intent) : QkViewModel( .withLatestFrom(conversation, { _, conversation -> conversation }) .map { conversation -> conversation.id } .autoDisposable(view.scope()) - .subscribe { threadId -> markRead.execute(threadId) } + .subscribe { threadId -> markRead.execute(threadId) { view.finish() } } // Show all messages view.menuItemIntent @@ -133,8 +133,11 @@ class QkReplyViewModel(intent: Intent) : QkViewModel( .withLatestFrom(conversation, { body, conversation -> val threadId = conversation.id val addresses = conversation.recipients.map { it.address } - sendMessage.execute(SendMessage.Params(threadId, addresses, body, listOf())) + view.setDraft("") + sendMessage.execute(SendMessage.Params(threadId, addresses, body, listOf())) { + view.finish() + } }) .autoDisposable(view.scope()) .subscribe()