diff --git a/app/src/main/java/com/starry/myne/ui/screens/home/viewmodels/HomeViewModel.kt b/app/src/main/java/com/starry/myne/ui/screens/home/viewmodels/HomeViewModel.kt index b631537d..e804dc9f 100644 --- a/app/src/main/java/com/starry/myne/ui/screens/home/viewmodels/HomeViewModel.kt +++ b/app/src/main/java/com/starry/myne/ui/screens/home/viewmodels/HomeViewModel.kt @@ -81,8 +81,10 @@ class HomeViewModel @Inject constructor( allBooksState = allBooksState.copy(isLoading = it) }, onRequest = { nextPage -> try { - // Slight delay for better UX - delay(400) + // Only add delay when loading first page to show shimmer effect + // and avoid flickering when navigating to home from welcome screen + // and immediately loading the first page. + if (nextPage == 1L) delay(400L) bookAPI.getAllBooks(nextPage, language.value) } catch (exc: Exception) { Result.failure(exc)