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

View file

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