Fix some things I did on accident

This commit is contained in:
Luna712 2023-10-06 18:34:32 -06:00
parent 10a3ba0a70
commit 8e9e50c89a
2 changed files with 5 additions and 1 deletions

View file

@ -340,8 +340,11 @@ class LibraryFragment : Fragment() {
observe(libraryViewModel.pages) { resource -> observe(libraryViewModel.pages) { resource ->
when (resource) { when (resource) {
is Resource.Success -> { is Resource.Success -> {
handler.removeCallbacks(startLoading)
val pages = resource.value val pages = resource.value
val showNotice = pages.all { it.items.isEmpty() } val showNotice = pages.all { it.items.isEmpty() }
binding?.apply { binding?.apply {
emptyListTextview.isVisible = showNotice emptyListTextview.isVisible = showNotice
if (showNotice) { if (showNotice) {
@ -418,10 +421,12 @@ class LibraryFragment : Fragment() {
}.attach() }.attach()
} }
} }
is Resource.Loading -> { is Resource.Loading -> {
// Only start loading after 200ms to prevent loading cached lists // Only start loading after 200ms to prevent loading cached lists
handler.postDelayed(startLoading, 200) handler.postDelayed(startLoading, 200)
} }
is Resource.Failure -> { is Resource.Failure -> {
stopLoading.run() stopLoading.run()
// No user indication it failed :( // No user indication it failed :(

View file

@ -95,7 +95,6 @@ class LibraryViewModel : ViewModel() {
val library = (libraryResource as? Resource.Success)?.value ?: return@let val library = (libraryResource as? Resource.Success)?.value ?: return@let
sortingMethods = library.supportedListSorting.toList() sortingMethods = library.supportedListSorting.toList()
//currentSortingMethod = null
repo.requireLibraryRefresh = false repo.requireLibraryRefresh = false