mirror of
				https://github.com/mihonapp/mihon.git
				synced 2025-11-04 08:08:55 +01:00 
			
		
		
		
	Fix unusable categories when content is filtered out
Fixes #8675 Effectively reverts #8633, which introduces weird edge cases
This commit is contained in:
		@@ -61,7 +61,7 @@ fun LibraryContent(
 | 
			
		||||
        val scope = rememberCoroutineScope()
 | 
			
		||||
        var isRefreshing by remember(pagerState.currentPage) { mutableStateOf(false) }
 | 
			
		||||
 | 
			
		||||
        if (!isLibraryEmpty && showPageTabs && categories.size > 1) {
 | 
			
		||||
        if (showPageTabs && categories.size > 1) {
 | 
			
		||||
            LibraryTabs(
 | 
			
		||||
                categories = categories,
 | 
			
		||||
                currentPageIndex = pagerState.currentPage,
 | 
			
		||||
 
 | 
			
		||||
@@ -777,12 +777,7 @@ class LibraryScreenModel(
 | 
			
		||||
            val categoryName = category.let {
 | 
			
		||||
                if (it.isSystemCategory) defaultCategoryTitle else it.name
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            val title = when {
 | 
			
		||||
                showCategoryTabs && categories.size != 1 -> defaultTitle
 | 
			
		||||
                libraryCount > 0 && !onlyDefaultCategory -> categoryName
 | 
			
		||||
                else -> defaultTitle
 | 
			
		||||
            }
 | 
			
		||||
            val title = if (showCategoryTabs) defaultTitle else categoryName
 | 
			
		||||
            val count = when {
 | 
			
		||||
                !showMangaCount -> null
 | 
			
		||||
                !showCategoryTabs -> getMangaCountForCategory(category)
 | 
			
		||||
 
 | 
			
		||||
@@ -149,7 +149,7 @@ object LibraryTab : Tab {
 | 
			
		||||
        ) { contentPadding ->
 | 
			
		||||
            when {
 | 
			
		||||
                state.isLoading -> LoadingScreen(modifier = Modifier.padding(contentPadding))
 | 
			
		||||
                state.searchQuery.isNullOrEmpty() && state.libraryCount == 0 -> {
 | 
			
		||||
                state.searchQuery.isNullOrEmpty() && !state.hasActiveFilters && state.libraryCount == 0 -> {
 | 
			
		||||
                    val handler = LocalUriHandler.current
 | 
			
		||||
                    EmptyScreen(
 | 
			
		||||
                        textResource = R.string.information_empty_library,
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user