From 5bdd7dcea9309e2b9a41759eea7b67e54631e336 Mon Sep 17 00:00:00 2001 From: Jay Date: Mon, 18 May 2020 23:26:28 -0400 Subject: [PATCH] Fixed sectioned library showing the wrong category when returning back to library tab when using custom grouping --- .../java/eu/kanade/tachiyomi/ui/library/LibraryPresenter.kt | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) 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 7940f86ab9..fb813580ec 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 @@ -137,10 +137,9 @@ class LibraryPresenter( fun restoreLibrary() { val items = libraryItems - val show = showAllCategories || !libraryIsGrouped || - categories.size == 1 + val show = showAllCategories || !libraryIsGrouped || categories.size == 1 if (!show) { - sectionedLibraryItems = items.groupBy { it.manga.category }.toMutableMap() + sectionedLibraryItems = items.groupBy { it.header.category.id!! }.toMutableMap() if (currentCategory == -1) currentCategory = categories.find { it.order == preferences.lastUsedCategory().getOrDefault() }?.id ?: 0