diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/category/ManageCategoryDialog.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/category/ManageCategoryDialog.kt index 707166441c..4d48d2862f 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/category/ManageCategoryDialog.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/category/ManageCategoryDialog.kt @@ -54,6 +54,7 @@ class ManageCategoryDialog(bundle: Bundle? = null) : private fun onPositiveButtonClick() { val view = dialogView ?: return + if (category.id ?: 0 <= 0) return val text = view.title.text.toString() val categoryExists = categoryExists(text) if (text.isNotBlank() && !categoryExists && !text.equals(category.name, true)) { @@ -85,6 +86,12 @@ class ManageCategoryDialog(bundle: Bundle? = null) : } fun onViewCreated(view: View) { + if (category.id ?: 0 <= 0) { + view.title.gone() + view.download_new.gone() + view.include_global.gone() + return + } view.edit_categories.setOnClickListener { router.popCurrentController() router.pushController(CategoryController().withFadeTransaction()) 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 b7afd5c601..c922b6eb02 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 @@ -424,6 +424,7 @@ class LibraryPresenter( it.toIntOrNull() }.toMutableSet() + if (categorySet.contains(0)) categories.add(0, createDefaultCategory()) if (showCategories) { categories.forEach { category -> val catId = category.id ?: return@forEach @@ -435,7 +436,7 @@ class LibraryPresenter( } else if (catId in categoriesHidden) { val mangaToRemove = items.filter { it.manga.category == catId } val mergedTitle = mangaToRemove.joinToString("-") { - it.manga.title + it.manga.title + "-" + it.manga.author } items.removeAll(mangaToRemove) val headerItem = headerItems[catId] @@ -446,8 +447,6 @@ class LibraryPresenter( } } - if (categorySet.contains(0)) categories.add(0, createDefaultCategory()) - categories.forEach { it.isHidden = it.id in categoriesHidden }