mirror of
https://github.com/yattee/yattee.git
synced 2026-11-01 01:17:20 +00:00
Give the empty tvOS Accounts screen a focusable Open Sources button
With no accounts the screen showed only a ContentUnavailableView, so the focus engine had nothing to land on and the remote could not reach the sidebar again; the app had to be force-quit. Sources is also where an account is signed in.
This commit is contained in:
@@ -158,6 +158,17 @@ struct AccountsListView: View {
|
||||
Label(String(localized: "accounts.empty.title"), systemImage: "person.crop.circle")
|
||||
} description: {
|
||||
Text(String(localized: "accounts.empty.description"))
|
||||
} actions: {
|
||||
#if os(tvOS)
|
||||
// Without a focusable element the focus engine has nowhere to
|
||||
// land, and the remote can no longer reach the sidebar either.
|
||||
// Sources is also where an account is actually signed in.
|
||||
NavigationLink {
|
||||
SourcesListView()
|
||||
} label: {
|
||||
Label(String(localized: "accounts.empty.openSources"), systemImage: "server.rack")
|
||||
}
|
||||
#endif
|
||||
}
|
||||
.frame(maxWidth: .infinity, maxHeight: .infinity)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user