Add deferred spinner for voice messages (#2018)

* Add  delayedLoaderPlaybackState

* Add more tests

* Fix Xcode 14 build error

* Refactor  delayedLoaderPlaybackState -> playerButtonPlaybackState

* Fix runtime issue
This commit is contained in:
Alfonso Grillo
2023-11-03 11:39:22 +01:00
committed by GitHub
parent b10d534c94
commit 530985e674
6 changed files with 75 additions and 10 deletions
@@ -88,13 +88,13 @@ private struct VoiceMessageButtonStyle: ButtonStyle {
}
extension VoiceMessageButton.State {
init(state: AudioPlayerPlaybackState) {
init(_ state: AudioPlayerPlaybackState) {
switch state {
case .loading:
self = .loading
case .playing:
self = .playing
default:
case .stopped, .error, .readyToPlay:
self = .paused
}
}