From f84d9a08b4af768b1e9920c43cc445c86f5427fc Mon Sep 17 00:00:00 2001 From: AntsyLich <59261191+AntsyLich@users.noreply.github.com> Date: Sat, 12 Oct 2024 05:12:38 +0600 Subject: [PATCH] ChapterNavigator: dispatch page change only when needed Co-authored-by: p --- .../presentation/reader/components/ChapterNavigator.kt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/eu/kanade/presentation/reader/components/ChapterNavigator.kt b/app/src/main/java/eu/kanade/presentation/reader/components/ChapterNavigator.kt index 97d48f3ec..b9aa00c6b 100644 --- a/app/src/main/java/eu/kanade/presentation/reader/components/ChapterNavigator.kt +++ b/app/src/main/java/eu/kanade/presentation/reader/components/ChapterNavigator.kt @@ -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, )