mirror of
https://github.com/yattee/yattee.git
synced 2026-10-23 05:02:53 +00:00
Give the tvOS network share discovery sheet a focusable Cancel
The toolbar Cancel is iOS/macOS only, so while scanning with no shares found yet (and when discovery is unavailable) the tvOS sheet had nothing the remote could focus.
This commit is contained in:
@@ -72,6 +72,15 @@ struct NetworkShareDiscoverySheet: View {
|
||||
Text(String(localized: "discovery.scanning"))
|
||||
.foregroundStyle(.secondary)
|
||||
}
|
||||
|
||||
#if os(tvOS)
|
||||
// The toolbar Cancel is iOS/macOS only. Until a share
|
||||
// turns up, this is the only thing the remote can focus.
|
||||
Button(String(localized: "common.cancel")) {
|
||||
service.stopDiscovery()
|
||||
dismiss()
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
@@ -133,6 +142,12 @@ struct NetworkShareDiscoverySheet: View {
|
||||
Label(String(localized: "discovery.unavailable.title"), systemImage: "exclamationmark.triangle")
|
||||
} description: {
|
||||
Text(String(localized: "discovery.unavailable.description"))
|
||||
} actions: {
|
||||
#if os(tvOS)
|
||||
Button(String(localized: "common.cancel")) {
|
||||
dismiss()
|
||||
}
|
||||
#endif
|
||||
}
|
||||
.frame(maxWidth: .infinity, maxHeight: .infinity)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user