Skip to content

Commit

Permalink
Use settledPage instead
Browse files Browse the repository at this point in the history
  • Loading branch information
StaehliJ authored and MGaetan89 committed Sep 27, 2024
1 parent f161c64 commit 4677299
Showing 1 changed file with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,8 @@ import kotlin.time.Duration.Companion.seconds
fun OptimizedStory(storyViewModel: StoryViewModel = viewModel()) {
val mediaItems = storyViewModel.mediaItems
val pagerState = rememberPagerState { mediaItems.size }

LaunchedEffect(pagerState.currentPage) {
storyViewModel.setActivePage(pagerState.currentPage)
LaunchedEffect(pagerState.settledPage) {
storyViewModel.setActivePage(pagerState.settledPage)
}

Box(modifier = Modifier.fillMaxSize()) {
Expand Down

0 comments on commit 4677299

Please sign in to comment.