Give the empty tvOS PeerTube instance browser a Retry button

When the directory returned no instances without an error, the tvOS
search header was hidden and the no-results state had nothing focusable.
This commit is contained in:
Arkadiusz Fal
2026-10-16 23:59:30 +02:00
parent 1f7c471fcc
commit 4fe7cceda5

View File

@@ -152,6 +152,18 @@ struct PeerTubeInstancesExploreView: View {
Label(String(localized: "peertube.explore.noResults"), systemImage: "magnifyingglass")
} description: {
Text(String(localized: "peertube.explore.noResults.description"))
} actions: {
#if os(tvOS)
// With nothing loaded the search header is hidden too, so
// without this the remote would have nothing to focus.
if allInstances.isEmpty {
Button(String(localized: "common.retry")) {
Task {
await loadAllInstances()
}
}
}
#endif
}
.frame(maxWidth: .infinity, maxHeight: .infinity)
} else {