mirror of
https://github.com/mihonapp/mihon.git
synced 2025-03-30 09:39:03 +03:00
ChapterNavigator: dispatch page change only when needed
Co-authored-by: p
This commit is contained in:
parent
37419cdc26
commit
f84d9a08b4
1 changed files with 4 additions and 1 deletions
|
@ -114,7 +114,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,
|
||||||
)
|
)
|
||||||
|
|
Loading…
Add table
Reference in a new issue