forked from upstream-mirrors/quik
Mark conversation read in onResume
This commit is contained in:
@@ -166,7 +166,6 @@ class ComposeViewModel @Inject constructor(
|
|||||||
// When the conversation changes, mark read, and update the threadId and the messages for the adapter
|
// When the conversation changes, mark read, and update the threadId and the messages for the adapter
|
||||||
disposables += conversation
|
disposables += conversation
|
||||||
.distinctUntilChanged { conversation -> conversation.id }
|
.distinctUntilChanged { conversation -> conversation.id }
|
||||||
.doOnNext { conversation -> markRead.execute(listOf(conversation.id)) }
|
|
||||||
.observeOn(AndroidSchedulers.mainThread())
|
.observeOn(AndroidSchedulers.mainThread())
|
||||||
.map { conversation ->
|
.map { conversation ->
|
||||||
val messages = messageRepo.getMessages(conversation.id)
|
val messages = messageRepo.getMessages(conversation.id)
|
||||||
@@ -435,7 +434,11 @@ class ComposeViewModel @Inject constructor(
|
|||||||
conversation.mapNotNull { conversation -> conversation.takeIf { it.isValid }?.id }.distinctUntilChanged())
|
conversation.mapNotNull { conversation -> conversation.takeIf { it.isValid }?.id }.distinctUntilChanged())
|
||||||
{ visible, threadId ->
|
{ visible, threadId ->
|
||||||
when (visible) {
|
when (visible) {
|
||||||
true -> activeConversationManager.setActiveConversation(threadId)
|
true -> {
|
||||||
|
activeConversationManager.setActiveConversation(threadId)
|
||||||
|
markRead.execute(listOf(threadId))
|
||||||
|
}
|
||||||
|
|
||||||
false -> activeConversationManager.setActiveConversation(null)
|
false -> activeConversationManager.setActiveConversation(null)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user