Fix loading screen not appearing when changing query in browser screen

Fixes #1438
Closes #1441

(cherry picked from commit 9aef08c333397caa4b897514cf76966592d3849c)

# Conflicts:
#	app/src/main/java/eu/kanade/tachiyomi/ui/browse/migration/search/SourceSearchScreen.kt
#	app/src/main/java/eu/kanade/tachiyomi/ui/browse/source/browse/BrowseSourceScreenModel.kt
This commit is contained in:
AntsyLich
2024-11-20 17:44:52 +06:00
committed by Jobobby04
parent b98dfd65b5
commit ce96b53f10
8 changed files with 33 additions and 13 deletions
+2
View File
@@ -45,5 +45,7 @@ dependencies {
implementation(compose.ui.tooling.preview)
implementation(compose.ui.util)
implementation(androidx.paging.runtime)
implementation(androidx.paging.compose)
implementation(kotlinx.immutables)
}
@@ -0,0 +1,16 @@
package mihon.presentation.core.util
import androidx.compose.runtime.Composable
import androidx.compose.runtime.collectAsState
import androidx.compose.runtime.getValue
import androidx.paging.PagingData
import androidx.paging.compose.LazyPagingItems
import androidx.paging.compose.collectAsLazyPagingItems
import kotlinx.coroutines.flow.Flow
import kotlinx.coroutines.flow.StateFlow
@Composable
fun <T: Any> StateFlow<Flow<PagingData<T>>>.collectAsLazyPagingItems(): LazyPagingItems<T> {
val flow by collectAsState()
return flow.collectAsLazyPagingItems()
}