Wait for library to load before creating Pager (#7623)
This commit is contained in:
@@ -14,7 +14,6 @@ import com.google.accompanist.swiperefresh.rememberSwipeRefreshState
|
||||
import eu.kanade.core.prefs.PreferenceMutableState
|
||||
import eu.kanade.domain.category.model.Category
|
||||
import eu.kanade.presentation.components.EmptyScreen
|
||||
import eu.kanade.presentation.components.LoadingScreen
|
||||
import eu.kanade.presentation.components.SwipeRefreshIndicator
|
||||
import eu.kanade.presentation.library.LibraryState
|
||||
import eu.kanade.tachiyomi.R
|
||||
@@ -44,21 +43,15 @@ fun LibraryContent(
|
||||
getLibraryForPage: @Composable (Int) -> State<List<LibraryItem>>,
|
||||
) {
|
||||
val categories = state.categories
|
||||
|
||||
val pagerState = rememberPagerState(currentPage.coerceAtMost(categories.lastIndex))
|
||||
|
||||
if (categories.isEmpty()) {
|
||||
LoadingScreen()
|
||||
return
|
||||
}
|
||||
|
||||
Column(
|
||||
modifier = Modifier.padding(contentPadding),
|
||||
) {
|
||||
if (showPageTabs && categories.size > 1) {
|
||||
LibraryTabs(
|
||||
state = pagerState,
|
||||
categories = state.categories,
|
||||
categories = categories,
|
||||
showMangaCount = showMangaCount,
|
||||
getNumberOfMangaForCategory = getNumberOfMangaForCategory,
|
||||
isDownloadOnly = isDownloadOnly,
|
||||
|
||||
Reference in New Issue
Block a user