Fixed sectioned library showing the wrong category when returning back to library tab

when using custom grouping
This commit is contained in:
Jay 2020-05-18 23:26:28 -04:00
parent 4df4a5b59d
commit 5bdd7dcea9

View File

@ -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