From d6f38568788d0bee6b55486b76600defd508bc4d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A9lanie=20Chauvel=20=28ariasuni=29?= Date: Wed, 29 Jan 2020 19:25:55 +0100 Subject: [PATCH] Refresh DM column when removing toot there instead of removing conversation (#1654) --- .../conversation/ConversationsViewModel.kt | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/app/src/main/java/com/keylesspalace/tusky/components/conversation/ConversationsViewModel.kt b/app/src/main/java/com/keylesspalace/tusky/components/conversation/ConversationsViewModel.kt index 3c61de80..0205ddec 100644 --- a/app/src/main/java/com/keylesspalace/tusky/components/conversation/ConversationsViewModel.kt +++ b/app/src/main/java/com/keylesspalace/tusky/components/conversation/ConversationsViewModel.kt @@ -128,15 +128,7 @@ class ConversationsViewModel @Inject constructor( fun remove(position: Int) { conversations.value?.getOrNull(position)?.let { conversation -> - /* this is not ideal since deleting last toot from an conversation - should not delete the conversation but show another toot of the conversation */ - timelineCases.delete(conversation.lastStatus.id) - .subscribeOn(Schedulers.io()) - .doOnError { t -> Log.w("ConversationViewModel", "Failed to delete conversation", t) } - .subscribe() - database.conversationDao().delete(conversation) - .subscribeOn(Schedulers.io()) - .subscribe() + refresh() } } @@ -146,4 +138,4 @@ class ConversationsViewModel @Inject constructor( .subscribe() } -} \ No newline at end of file +}