Skip to content

Commit

Permalink
ChapterNavigator: dispatch page change only when needed
Browse files Browse the repository at this point in the history
Co-authored-by: p
  • Loading branch information
AntsyLich committed Oct 11, 2024
1 parent 37419cd commit f84d9a0
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,10 @@ fun ChapterNavigator(
valueRange = 1f..totalPages.toFloat(),
steps = totalPages - 2,
onValueChange = {
onSliderValueChange(it.roundToInt() - 1)
val new = it.roundToInt() - 1
if (new != currentPage) {
onSliderValueChange(new)
}
},
interactionSource = interactionSource,
)
Expand Down

0 comments on commit f84d9a0

Please sign in to comment.