From 60150423d7771d9317883e1e2a26a59fba886a72 Mon Sep 17 00:00:00 2001 From: arkon Date: Tue, 21 Nov 2023 22:30:32 -0500 Subject: [PATCH] Call WheelPicker onSelectionChanged with initial value Fixes #10157 We realistically only ever use the picker in contexts where we later confirm or cancel with the selected value, so this is fine. If the caller wants to ignore the initial value, they can always check if it's distinct before/after there. --- .../java/tachiyomi/presentation/core/components/WheelPicker.kt | 2 -- 1 file changed, 2 deletions(-) diff --git a/presentation-core/src/main/java/tachiyomi/presentation/core/components/WheelPicker.kt b/presentation-core/src/main/java/tachiyomi/presentation/core/components/WheelPicker.kt index 636e1ebacf..9cbb156c64 100644 --- a/presentation-core/src/main/java/tachiyomi/presentation/core/components/WheelPicker.kt +++ b/presentation-core/src/main/java/tachiyomi/presentation/core/components/WheelPicker.kt @@ -44,7 +44,6 @@ import androidx.compose.ui.unit.dp import kotlinx.collections.immutable.ImmutableList import kotlinx.coroutines.flow.collectLatest import kotlinx.coroutines.flow.distinctUntilChanged -import kotlinx.coroutines.flow.drop import kotlinx.coroutines.flow.map import kotlinx.coroutines.launch import tachiyomi.presentation.core.components.material.padding @@ -126,7 +125,6 @@ private fun WheelPicker( snapshotFlow { lazyListState.firstVisibleItemScrollOffset } .map { calculateSnappedItemIndex(lazyListState) } .distinctUntilChanged() - .drop(1) .collectLatest { haptic.performHapticFeedback(HapticFeedbackType.TextHandleMove) internalOnSelectionChanged(it)