Fix default category showing if nothing is in it

This commit is contained in:
Syer10
2025-10-07 18:21:11 -04:00
parent 616aa04c6c
commit 534293a7ed
3 changed files with 7 additions and 4 deletions

View File

@@ -9,4 +9,7 @@ fragment CategoryFragment on CategoryType {
key
value
}
mangas {
totalCount
}
}

View File

@@ -76,7 +76,9 @@ class CategoryRepositoryImpl(
.toFlow()
.map {
val data = it.dataAssertNoErrors
data.categories.nodes.map { it.categoryFragment.toCategory() }
data.categories.nodes
.filterNot { it.categoryFragment.id == 0 && it.categoryFragment.mangas.totalCount == 0 }
.map { it.categoryFragment.toCategory() }
}
override fun createCategory(name: String): Flow<Unit> =