From 5f378e28b63e9d606fa3be1acf6650b93ff86daa Mon Sep 17 00:00:00 2001 From: Ivan Iskandar <12537387+ivaniskandar@users.noreply.github.com> Date: Sun, 14 Aug 2022 01:34:51 +0700 Subject: [PATCH] UpdatesPresenter: Prevent unnecessary screen recompose (#7742) --- .../eu/kanade/tachiyomi/ui/recent/updates/UpdatesPresenter.kt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/recent/updates/UpdatesPresenter.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/recent/updates/UpdatesPresenter.kt index a4aca7b730..67eb48a46e 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/recent/updates/UpdatesPresenter.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/recent/updates/UpdatesPresenter.kt @@ -30,6 +30,7 @@ import kotlinx.coroutines.channels.Channel import kotlinx.coroutines.flow.Flow import kotlinx.coroutines.flow.catch import kotlinx.coroutines.flow.collectLatest +import kotlinx.coroutines.flow.distinctUntilChanged import kotlinx.coroutines.flow.receiveAsFlow import logcat.LogPriority import uy.kohesive.injekt.Injekt @@ -81,6 +82,7 @@ class UpdatesPresenter( } getUpdates.subscribe(calendar) + .distinctUntilChanged() .catch { logcat(LogPriority.ERROR, it) _events.send(Event.InternalError)