Add a “Show Original” accessibility action to statuses when relevant
This commit is contained in:
parent
ab7166017b
commit
97f5132977
|
@ -628,10 +628,19 @@ extension StatusView {
|
|||
get {
|
||||
(contentMetaText.textView.accessibilityCustomActions ?? [])
|
||||
+ toolbarActions
|
||||
+ (hideTranslationAction.map { [$0] } ?? [])
|
||||
+ (authorView.accessibilityCustomActions ?? [])
|
||||
}
|
||||
set { }
|
||||
}
|
||||
|
||||
private var hideTranslationAction: UIAccessibilityCustomAction? {
|
||||
guard viewModel.translatedFromLanguage != nil else { return nil }
|
||||
return UIAccessibilityCustomAction(name: L10n.Common.Controls.Status.Translation.showOriginal) { [weak self] _ in
|
||||
self?.revertTranslation()
|
||||
return true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// MARK: - AdaptiveContainerView
|
||||
|
|
Loading…
Reference in New Issue