Give the empty tvOS translators screen a focusable Done button

If the bundled translator list fails to load the screen is a bare
ContentUnavailableView, leaving the tvOS remote nothing to focus.
This commit is contained in:
Arkadiusz Fal
2026-10-17 08:59:14 +02:00
parent 34cec578ad
commit eec39445b4

View File

@@ -9,6 +9,9 @@ import NukeUI
import SwiftUI
struct TranslationContributorsView: View {
#if os(tvOS)
@Environment(\.dismiss) private var dismiss
#endif
@State private var contributors: [TranslationContributor] = []
var body: some View {
@@ -30,6 +33,13 @@ struct TranslationContributorsView: View {
if contributors.isEmpty {
ContentUnavailableView {
Label(String(localized: "settings.translators.empty"), systemImage: "globe")
} actions: {
#if os(tvOS)
// Nothing else here is focusable; without it the remote is stuck.
Button(String(localized: "common.done")) {
dismiss()
}
#endif
}
.frame(maxWidth: .infinity, maxHeight: .infinity)
} else {