From f54adb49a1af381798a8d65db3d82cc92e221139 Mon Sep 17 00:00:00 2001 From: Ivan Iskandar <12537387+ivaniskandar@users.noreply.github.com> Date: Fri, 16 Sep 2022 19:35:15 +0700 Subject: [PATCH] ExtensionsPresenter: Use StateFlow for extensions list (#8017) --- .../tachiyomi/ui/browse/extension/ExtensionsPresenter.kt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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 1416a372a..a4868a703 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 @@ -22,6 +22,7 @@ import kotlinx.coroutines.flow.collectLatest import kotlinx.coroutines.flow.combine 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 @@ -77,7 +78,7 @@ class ExtensionsPresenter( presenterScope.launchIO { combine( _query, - getExtensions.subscribe(), + getExtensions.subscribe().stateIn(presenterScope), _currentDownloads, ) { query, (_updates, _installed, _available, _untrusted), downloads -> val searchQuery = query ?: ""