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

This commit is contained in:
Mélanie Chauvel (ariasuni) 2020-01-29 19:25:55 +01:00 committed by GitHub
parent c57040f31a
commit d6f3856878
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 10 deletions

View File

@ -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()
}
}
}