pr suggestions

This commit is contained in:
Mauro Romito
2026-02-19 22:03:23 +01:00
committed by Mauro
parent 43fa220b42
commit d6eccd3a64
6 changed files with 54 additions and 41 deletions
@@ -419,15 +419,7 @@ class TimelineInteractionHandler {
// MARK: Audio Playback
func changePlaybackSpeed(for itemID: TimelineItemIdentifier) {
let availableSpeeds = VoiceMessagePlaybackSpeed.allCases
guard let currentIndex = availableSpeeds.firstIndex(of: appSettings.voiceMessagePlaybackSpeed) else {
appSettings.voiceMessagePlaybackSpeed = .default
audioPlayerState(for: itemID)?.setPlaybackSpeed(VoiceMessagePlaybackSpeed.default)
return
}
let nextIndex = (currentIndex + 1) % availableSpeeds.count
let nextSpeed = availableSpeeds[nextIndex]
let nextSpeed = appSettings.voiceMessagePlaybackSpeed.next
appSettings.voiceMessagePlaybackSpeed = nextSpeed
audioPlayerState(for: itemID)?.setPlaybackSpeed(nextSpeed)
}