UpdatesPresenter: Prevent unnecessary screen recompose (#7742)

(cherry picked from commit 5f378e28b63e9d606fa3be1acf6650b93ff86daa)
This commit is contained in:
Ivan Iskandar 2022-08-14 01:34:51 +07:00 committed by Jobobby04
parent b86a549624
commit 33e0d34afa

View File

@ -30,6 +30,7 @@ import kotlinx.coroutines.channels.Channel
import kotlinx.coroutines.flow.Flow import kotlinx.coroutines.flow.Flow
import kotlinx.coroutines.flow.catch import kotlinx.coroutines.flow.catch
import kotlinx.coroutines.flow.collectLatest import kotlinx.coroutines.flow.collectLatest
import kotlinx.coroutines.flow.distinctUntilChanged
import kotlinx.coroutines.flow.receiveAsFlow import kotlinx.coroutines.flow.receiveAsFlow
import logcat.LogPriority import logcat.LogPriority
import uy.kohesive.injekt.Injekt import uy.kohesive.injekt.Injekt
@ -81,6 +82,7 @@ class UpdatesPresenter(
} }
getUpdates.subscribe(calendar) getUpdates.subscribe(calendar)
.distinctUntilChanged()
.catch { .catch {
logcat(LogPriority.ERROR, it) logcat(LogPriority.ERROR, it)
_events.send(Event.InternalError) _events.send(Event.InternalError)