mirror of
https://github.com/quik-sms/quik.git
synced 2026-11-17 03:28:52 +01:00
Update badge whenever message read status is modified
This commit is contained in:
@@ -25,13 +25,15 @@ import javax.inject.Inject
|
||||
|
||||
class MarkRead @Inject constructor(
|
||||
private val messageRepo: MessageRepository,
|
||||
private val notificationManager: NotificationManager
|
||||
private val notificationManager: NotificationManager,
|
||||
private val updateBadge: UpdateBadge
|
||||
) : Interactor<Long>() {
|
||||
|
||||
override fun buildObservable(params: Long): Flowable<Unit> {
|
||||
override fun buildObservable(params: Long): Flowable<*> {
|
||||
return Flowable.just(Unit)
|
||||
.doOnNext { messageRepo.markRead(params) }
|
||||
.doOnNext { notificationManager.update(params) }
|
||||
.flatMap { updateBadge.buildObservable(Unit) } // Update the badge
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user