Explorar o código

fix: 发现页首页筛选问题

HapeLee hai 5 meses
pai
achega
74618447cd

+ 8 - 0
app/src/main/java/io/legado/app/ui/book/explore/ExploreShowScreen.kt

@@ -167,6 +167,14 @@ fun ExploreShowScreen(
         }
         }
     }
     }
 
 
+    // Auto-load next page when filter removes all books on the current page
+    // but the ViewModel hasn't reached the end of data yet.
+    LaunchedEffect(books.isEmpty(), state.isLoading, state.isEnd, state.books.size) {
+        if (books.isEmpty() && !state.isLoading && !state.isEnd && state.books.isNotEmpty()) {
+            viewModel.onIntent(ExploreShowIntent.ForceLoadNext)
+        }
+    }
+
     LaunchedEffect(isGridMode) {
     LaunchedEffect(isGridMode) {
         if (isGridMode) {
         if (isGridMode) {
             if (listState.firstVisibleItemIndex > 0) {
             if (listState.firstVisibleItemIndex > 0) {