Refresh DM column when removing toot there instead of removing conversation (#1654)

main
Mélanie Chauvel (ariasuni) 5 years ago committed by GitHub
parent 79ccb0d979
commit 4907a051ab
  1. 10
      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()
}
}

Loading…
Cancel
Save