소스 검색

ExtensionsPresenter: Use StateFlow for extensions list (#8017)

Ivan Iskandar 2 년 전
부모
커밋
f54adb49a1
1개의 변경된 파일2개의 추가작업 그리고 1개의 파일을 삭제
  1. 2 1
      app/src/main/java/eu/kanade/tachiyomi/ui/browse/extension/ExtensionsPresenter.kt

+ 2 - 1
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 ?: ""