diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryPresenter.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryPresenter.kt index 775e34ee1..b43cd272e 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryPresenter.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryPresenter.kt @@ -412,14 +412,14 @@ class LibraryPresenter( */ private fun getLibraryObservable(): Observable { return combine(getCategoriesFlow(), getLibraryMangasFlow()) { dbCategories, libraryManga -> - val categories = if (libraryManga.containsKey(0)) { + val categories = if (libraryManga.containsKey(0) || libraryManga.isEmpty()) { arrayListOf(Category.default(context)) + dbCategories } else { dbCategories } libraryManga.forEach { (categoryId, libraryManga) -> - val category = categories.first { category -> category.id == categoryId.toLong() } + val category = categories.first { category -> category.id == categoryId } libraryManga.forEach { libraryItem -> libraryItem.displayMode = category.displayMode }