Animate the removal of translations

The reset of a translation when the translation type is changed is now
animated, which is important for iPad users if they've translated a
post in the sidebar.
This commit is contained in:
Paul Schuetz 2024-05-09 22:21:36 +02:00
parent e651f5c12c
commit 7f3bfb6a7b
No known key found for this signature in database
GPG key ID: 4FDE1FB89050039E

View file

@ -65,7 +65,9 @@ struct StatusRowTranslateView: View {
var body: some View {
generalTranslateButton
.onChange(of: preferences.preferredTranslationType) { _, _ in
_ = viewModel.updatePreferredTranslation()
withAnimation {
_ = viewModel.updatePreferredTranslation()
}
}
if let translation = viewModel.translation, !viewModel.isLoadingTranslation, preferences.preferredTranslationType != .useApple {