diff --git a/Yattee/Views/Settings/ImportPlaylistsView.swift b/Yattee/Views/Settings/ImportPlaylistsView.swift index e028d700..9c0d1920 100644 --- a/Yattee/Views/Settings/ImportPlaylistsView.swift +++ b/Yattee/Views/Settings/ImportPlaylistsView.swift @@ -11,6 +11,9 @@ struct ImportPlaylistsView: View { let instance: Instance @Environment(\.appEnvironment) private var appEnvironment + #if os(tvOS) + @Environment(\.dismiss) private var dismiss + #endif @State private var playlists: [Playlist] = [] @State private var importedPlaylistIDs: Set = [] @@ -177,11 +180,19 @@ struct ImportPlaylistsView: View { } private var emptyView: some View { - ContentUnavailableView( - String(localized: "import.playlists.emptyTitle"), - systemImage: "list.bullet.rectangle", - description: Text(String(localized: "import.playlists.emptyDescription")) - ) + ContentUnavailableView { + Label(String(localized: "import.playlists.emptyTitle"), systemImage: "list.bullet.rectangle") + } description: { + Text(String(localized: "import.playlists.emptyDescription")) + } actions: { + #if os(tvOS) + // Nothing in the content is focusable here; the container's + // toolbar Done is not something to rely on to keep the remote free. + Button(String(localized: "common.done")) { + dismiss() + } + #endif + } .frame(maxWidth: .infinity, maxHeight: .infinity) .accessibilityIdentifier(AccessibilityID.emptyState) } diff --git a/Yattee/Views/Settings/ImportSubscriptionsView.swift b/Yattee/Views/Settings/ImportSubscriptionsView.swift index b80a9e8e..65ff8d50 100644 --- a/Yattee/Views/Settings/ImportSubscriptionsView.swift +++ b/Yattee/Views/Settings/ImportSubscriptionsView.swift @@ -12,6 +12,9 @@ struct ImportSubscriptionsView: View { let instance: Instance @Environment(\.appEnvironment) private var appEnvironment + #if os(tvOS) + @Environment(\.dismiss) private var dismiss + #endif @State private var channels: [Channel] = [] @State private var subscribedChannelIDs: Set = [] @@ -133,11 +136,19 @@ struct ImportSubscriptionsView: View { } private var emptyView: some View { - ContentUnavailableView( - String(localized: "import.subscriptions.emptyTitle"), - systemImage: "person.2.slash", - description: Text(String(localized: "import.subscriptions.emptyDescription")) - ) + ContentUnavailableView { + Label(String(localized: "import.subscriptions.emptyTitle"), systemImage: "person.2.slash") + } description: { + Text(String(localized: "import.subscriptions.emptyDescription")) + } actions: { + #if os(tvOS) + // Nothing in the content is focusable here; the container's + // toolbar Done is not something to rely on to keep the remote free. + Button(String(localized: "common.done")) { + dismiss() + } + #endif + } .frame(maxWidth: .infinity, maxHeight: .infinity) .accessibilityIdentifier(AccessibilityID.emptyState) }