Play sound effects before the server action for status

This commit is contained in:
Thomas Ricouard 2023-03-08 19:02:12 +01:00
parent f6b987a18a
commit 4c7d0f3386

View file

@ -162,17 +162,17 @@ struct StatusRowActionsView: View {
HapticManager.shared.fireHaptic(of: .notification(.success)) HapticManager.shared.fireHaptic(of: .notification(.success))
switch action { switch action {
case .respond: case .respond:
viewModel.routerPath.presentedSheet = .replyToStatusEditor(status: viewModel.localStatus ?? viewModel.status)
SoundEffectManager.shared.playSound(of: .share) SoundEffectManager.shared.playSound(of: .share)
viewModel.routerPath.presentedSheet = .replyToStatusEditor(status: viewModel.localStatus ?? viewModel.status)
case .favorite: case .favorite:
await statusDataController.toggleFavorite(remoteStatus: viewModel.localStatusId)
SoundEffectManager.shared.playSound(of: .favorite) SoundEffectManager.shared.playSound(of: .favorite)
await statusDataController.toggleFavorite(remoteStatus: viewModel.localStatusId)
case .bookmark: case .bookmark:
await statusDataController.toggleBookmark(remoteStatus: viewModel.localStatusId)
SoundEffectManager.shared.playSound(of: .bookmark) SoundEffectManager.shared.playSound(of: .bookmark)
await statusDataController.toggleBookmark(remoteStatus: viewModel.localStatusId)
case .boost: case .boost:
await statusDataController.toggleReblog(remoteStatus: viewModel.localStatusId)
SoundEffectManager.shared.playSound(of: .boost) SoundEffectManager.shared.playSound(of: .boost)
await statusDataController.toggleReblog(remoteStatus: viewModel.localStatusId)
default: default:
break break
} }