diff --git a/app/src/main/java/eu/kanade/presentation/updates/UpdatesUiItem.kt b/app/src/main/java/eu/kanade/presentation/updates/UpdatesUiItem.kt index 8e56b9f80..277881d75 100644 --- a/app/src/main/java/eu/kanade/presentation/updates/UpdatesUiItem.kt +++ b/app/src/main/java/eu/kanade/presentation/updates/UpdatesUiItem.kt @@ -118,10 +118,9 @@ fun LazyListScope.updatesUiItems( } is UpdatesUiModel.Item -> { val updatesItem = item.item - val update = updatesItem.update UpdatesUiItem( modifier = Modifier.animateItemPlacement(), - update = update, + update = updatesItem.update, selected = updatesItem.selected, onLongClick = { onUpdateSelected(updatesItem, !updatesItem.selected, true, true) diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/browse/extension/ExtensionsPresenter.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/browse/extension/ExtensionsPresenter.kt index c21e140d1..a603be96c 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/browse/extension/ExtensionsPresenter.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/browse/extension/ExtensionsPresenter.kt @@ -20,9 +20,9 @@ import kotlinx.coroutines.flow.StateFlow import kotlinx.coroutines.flow.asStateFlow import kotlinx.coroutines.flow.collectLatest import kotlinx.coroutines.flow.combine -import kotlinx.coroutines.flow.debounce import kotlinx.coroutines.flow.launchIn import kotlinx.coroutines.flow.onEach +import kotlinx.coroutines.flow.stateIn import kotlinx.coroutines.flow.update import rx.Observable import uy.kohesive.injekt.Injekt @@ -116,7 +116,7 @@ class ExtensionsPresenter( items } - .debounce(500) // Avoid crashes due to LazyColumn rendering + .stateIn(presenterScope) .collectLatest { state.isLoading = false state.items = it diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/browse/source/SourcesPresenter.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/browse/source/SourcesPresenter.kt index 3b4669f11..2d2bb60cb 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/browse/source/SourcesPresenter.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/browse/source/SourcesPresenter.kt @@ -20,12 +20,14 @@ import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.channels.Channel import kotlinx.coroutines.flow.catch +import kotlinx.coroutines.flow.collectLatest import kotlinx.coroutines.flow.combine import kotlinx.coroutines.flow.debounce import kotlinx.coroutines.flow.flowOf import kotlinx.coroutines.flow.flowOn import kotlinx.coroutines.flow.launchIn import kotlinx.coroutines.flow.receiveAsFlow +import kotlinx.coroutines.flow.stateIn import logcat.LogPriority import uy.kohesive.injekt.Injekt import uy.kohesive.injekt.api.get @@ -58,7 +60,7 @@ class SourcesPresenter( fun onCreate() { // SY --> combine( - getEnabledSources.subscribe().debounce(500), // Avoid crashes due to LazyColumn rendering + getEnabledSources.subscribe(), // Avoid crashes due to LazyColumn rendering getSourceCategories.subscribe(), getShowLatest.subscribe(controllerMode), flowOf(controllerMode == SourcesController.Mode.CATALOGUE), @@ -69,6 +71,7 @@ class SourcesPresenter( _events.send(Event.FailedFetchingSources) } .flowOn(Dispatchers.IO) + .stateIn(presenterScope) .launchIn(presenterScope) // SY <-- } 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 dbb02caa0..410860a71 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 @@ -33,9 +33,9 @@ import kotlinx.coroutines.flow.Flow import kotlinx.coroutines.flow.catch import kotlinx.coroutines.flow.collectLatest import kotlinx.coroutines.flow.combine -import kotlinx.coroutines.flow.debounce import kotlinx.coroutines.flow.distinctUntilChanged import kotlinx.coroutines.flow.receiveAsFlow +import kotlinx.coroutines.flow.stateIn import kotlinx.coroutines.launch import logcat.LogPriority import uy.kohesive.injekt.Injekt @@ -87,11 +87,11 @@ class UpdatesPresenter( getUpdates.subscribe(calendar).distinctUntilChanged(), downloadCache.changes, ) { updates, _ -> updates } - .debounce(500) // Avoid crashes due to LazyColumn rendering .catch { logcat(LogPriority.ERROR, it) _events.send(Event.InternalError) } + .stateIn(presenterScope) .collectLatest { updates -> state.items = updates.toUpdateItems() state.isLoading = false