UpdatesPresenter: Prevent unnecessary screen recompose

This commit is contained in:
Ivan Iskandar 2022-08-14 01:11:12 +07:00
parent aab5a56892
commit 038d8e71d1
No known key found for this signature in database
GPG Key ID: 2C57784F9E46D60D

View File

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