Dont scroll the miniplayer when the user is scrubbing audio

This commit is contained in:
Jackson Harper 2022-09-15 15:54:21 +08:00
parent e1f28ec189
commit fd2df9f926

View file

@ -402,15 +402,24 @@ public struct MiniPlayer: View {
}
}
var scrubbing: Bool {
switch audioController.scrubState {
case .scrubStarted:
return true
default:
return false
}
}
func onDragChanged(value: DragGesture.Value) {
if value.translation.height > 0, expanded {
if value.translation.height > 0, expanded, !scrubbing {
offset = value.translation.height
}
}
func onDragEnded(value: DragGesture.Value) {
withAnimation(.interactiveSpring()) {
if value.translation.height > minExpandedHeight {
if value.translation.height > minExpandedHeight, !scrubbing {
expanded = false
}
offset = 0