mirror of
https://github.com/tachiyomiorg/tachiyomi.git
synced 2024-11-20 05:29:18 +01:00
Fixed #788
This commit is contained in:
parent
03b305ed8f
commit
627ea5fe33
@ -173,12 +173,10 @@ class LibraryPresenter(
|
|||||||
fun restoreLibrary() {
|
fun restoreLibrary() {
|
||||||
val items = libraryItems
|
val items = libraryItems
|
||||||
val show = showAllCategories || !libraryIsGrouped || categories.size == 1
|
val show = showAllCategories || !libraryIsGrouped || categories.size == 1
|
||||||
if (!show) {
|
sectionedLibraryItems = items.groupBy { it.header.category.id!! }.toMutableMap()
|
||||||
sectionedLibraryItems = items.groupBy { it.header.category.id!! }.toMutableMap()
|
if (!show && currentCategory == -1) currentCategory = categories.find {
|
||||||
if (currentCategory == -1) currentCategory = categories.find {
|
it.order == preferences.lastUsedCategory().getOrDefault()
|
||||||
it.order == preferences.lastUsedCategory().getOrDefault()
|
}?.id ?: 0
|
||||||
}?.id ?: 0
|
|
||||||
}
|
|
||||||
view.onNextLibraryUpdate(
|
view.onNextLibraryUpdate(
|
||||||
if (!show) sectionedLibraryItems[currentCategory]
|
if (!show) sectionedLibraryItems[currentCategory]
|
||||||
?: sectionedLibraryItems[categories.first().id] ?: blankItem()
|
?: sectionedLibraryItems[categories.first().id] ?: blankItem()
|
||||||
@ -196,12 +194,10 @@ class LibraryPresenter(
|
|||||||
libraryItems = items
|
libraryItems = items
|
||||||
val showAll = showAllCategories || !libraryIsGrouped ||
|
val showAll = showAllCategories || !libraryIsGrouped ||
|
||||||
categories.size <= 1
|
categories.size <= 1
|
||||||
if (!showAll) {
|
sectionedLibraryItems = items.groupBy { it.header.category.id ?: 0 }.toMutableMap()
|
||||||
sectionedLibraryItems = items.groupBy { it.header.category.id ?: 0 }.toMutableMap()
|
if (!showAll && currentCategory == -1) currentCategory = categories.find {
|
||||||
if (currentCategory == -1) currentCategory = categories.find {
|
it.order == preferences.lastUsedCategory().getOrDefault()
|
||||||
it.order == preferences.lastUsedCategory().getOrDefault()
|
}?.id ?: 0
|
||||||
}?.id ?: 0
|
|
||||||
}
|
|
||||||
withUIContext {
|
withUIContext {
|
||||||
view.onNextLibraryUpdate(
|
view.onNextLibraryUpdate(
|
||||||
if (!showAll) sectionedLibraryItems[currentCategory]
|
if (!showAll) sectionedLibraryItems[currentCategory]
|
||||||
|
Loading…
Reference in New Issue
Block a user