mirror of
https://github.com/yattee/yattee.git
synced 2026-11-02 09:57:20 +00:00
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:
@@ -9,6 +9,9 @@ import NukeUI
|
|||||||
import SwiftUI
|
import SwiftUI
|
||||||
|
|
||||||
struct TranslationContributorsView: View {
|
struct TranslationContributorsView: View {
|
||||||
|
#if os(tvOS)
|
||||||
|
@Environment(\.dismiss) private var dismiss
|
||||||
|
#endif
|
||||||
@State private var contributors: [TranslationContributor] = []
|
@State private var contributors: [TranslationContributor] = []
|
||||||
|
|
||||||
var body: some View {
|
var body: some View {
|
||||||
@@ -30,6 +33,13 @@ struct TranslationContributorsView: View {
|
|||||||
if contributors.isEmpty {
|
if contributors.isEmpty {
|
||||||
ContentUnavailableView {
|
ContentUnavailableView {
|
||||||
Label(String(localized: "settings.translators.empty"), systemImage: "globe")
|
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)
|
.frame(maxWidth: .infinity, maxHeight: .infinity)
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in New Issue
Block a user