ChapterNavigator: dispatch page change only when needed

Co-authored-by: p
(cherry picked from commit f84d9a08b4af768b1e9920c43cc445c86f5427fc)
This commit is contained in:
AntsyLich 2024-10-12 05:12:38 +06:00 committed by Jobobby04
parent bccd1eff2b
commit 91ae683b74

View File

@ -142,7 +142,10 @@ fun ChapterNavigator(
valueRange = 1f..totalPages.toFloat(), valueRange = 1f..totalPages.toFloat(),
steps = totalPages - 2, steps = totalPages - 2,
onValueChange = { onValueChange = {
onSliderValueChange(it.roundToInt() - 1) val new = it.roundToInt() - 1
if (new != currentPage) {
onSliderValueChange(new)
}
}, },
interactionSource = interactionSource, interactionSource = interactionSource,
) )