ChapterNavigator: dispatch page change only when needed

Co-authored-by: p
This commit is contained in:
AntsyLich 2024-10-12 05:12:38 +06:00
parent 37419cdc26
commit f84d9a08b4
No known key found for this signature in database

View file

@ -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,
)