Skip to content

Commit

Permalink
Fix app crashing when there are no featured posts
Browse files Browse the repository at this point in the history
  • Loading branch information
msasikanth committed Nov 25, 2023
1 parent 156f9c4 commit 6e549c2
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,11 @@ private fun FeaturedSectionBlurredBackground(
modifier =
modifier.aspectRatio(featuredImageBackgroundAspectRatio).graphicsLayer {
val offsetFraction =
pagerState.getOffsetFractionForPage(index).absoluteValue.coerceIn(0f, 1f)
if (index in 0..pagerState.pageCount) {
pagerState.getOffsetFractionForPage(index).absoluteValue.coerceIn(0f, 1f)
} else {
0f
}
alpha = ((1f - offsetFraction) / 1f)

val blurRadiusInPx = 100.dp.toPx()
Expand Down

0 comments on commit 6e549c2

Please sign in to comment.