From af142b190bcf2caa0da2e4253a97f90b4e0921f8 Mon Sep 17 00:00:00 2001 From: Satindar Dhillon Date: Thu, 23 Mar 2023 13:34:33 -0700 Subject: [PATCH] reset cursor when initial load is called (happens after rest data cache action) --- .../app/omnivore/omnivore/ui/library/LibraryViewModel.kt | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/android/Omnivore/app/src/main/java/app/omnivore/omnivore/ui/library/LibraryViewModel.kt b/android/Omnivore/app/src/main/java/app/omnivore/omnivore/ui/library/LibraryViewModel.kt index 9dd990619..4f73811c8 100644 --- a/android/Omnivore/app/src/main/java/app/omnivore/omnivore/ui/library/LibraryViewModel.kt +++ b/android/Omnivore/app/src/main/java/app/omnivore/omnivore/ui/library/LibraryViewModel.kt @@ -110,6 +110,14 @@ class LibraryViewModel @Inject constructor( } fun initialLoad() { + if (getLastSyncTime() == null) { + hasLoadedInitialFilters = false + cursor = null + librarySearchCursor = null + searchIdx = 0 + receivedIdx = 0 + } + if (hasLoadedInitialFilters) { return } load() }