more tracepot crash fixes

This commit is contained in:
Jay 2020-05-25 14:20:53 -04:00
parent 11598362b8
commit d7335bdc2f
2 changed files with 3 additions and 3 deletions

View File

@ -724,8 +724,8 @@ class LibraryController(
if (justStarted && freshStart) { if (justStarted && freshStart) {
scrollToHeader(activeCategory) scrollToHeader(activeCategory)
} }
recycler.post { recycler?.post {
elevateAppBar(recycler.canScrollVertically(-1)) elevateAppBar(recycler?.canScrollVertically(-1) == true)
setActiveCategory() setActiveCategory()
} }

View File

@ -158,7 +158,7 @@ class LibraryPresenter(
private suspend fun sectionLibrary(items: List<LibraryItem>, freshStart: Boolean = false) { private suspend fun sectionLibrary(items: List<LibraryItem>, freshStart: Boolean = false) {
libraryItems = items libraryItems = items
val showAll = showAllCategories || !libraryIsGrouped || val showAll = showAllCategories || !libraryIsGrouped ||
categories.size == 1 categories.size <= 1
if (!showAll) { if (!showAll) {
sectionedLibraryItems = items.groupBy { it.header.category.id ?: 0 }.toMutableMap() sectionedLibraryItems = items.groupBy { it.header.category.id ?: 0 }.toMutableMap()
if (currentCategory == -1) currentCategory = categories.find { if (currentCategory == -1) currentCategory = categories.find {