Skip to content

Commit

Permalink
Fix app crashing when removing the feed if there is only one present
Browse files Browse the repository at this point in the history
  • Loading branch information
msasikanth committed Oct 5, 2023
1 parent f8ed350 commit 4723610
Showing 1 changed file with 12 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,12 @@ private fun DefaultFeaturedPostItem(
.aspectRatio(featuredImageAspectRatio)
.background(AppTheme.colorScheme.surfaceContainerLowest)
.graphicsLayer {
translationX = pagerState.getOffsetFractionForPage(page) * 250f
translationX =
if (page in 0..pagerState.pageCount) {
pagerState.getOffsetFractionForPage(page) * 250f
} else {
0f
}
scaleX = 1.08f
scaleY = 1.08f
},
Expand Down Expand Up @@ -175,7 +180,12 @@ private fun LargeScreenFeaturedPostItem(
.weight(0.92f)
.background(AppTheme.colorScheme.surfaceContainerLowest)
.graphicsLayer {
translationX = pagerState.getOffsetFractionForPage(page) * 250f
translationX =
if (page in 0..pagerState.pageCount) {
pagerState.getOffsetFractionForPage(page) * 250f
} else {
0f
}
scaleX = 1.08f
scaleY = 1.08f
},
Expand Down

0 comments on commit 4723610

Please sign in to comment.