mirror of
https://github.com/yattee/yattee.git
synced 2026-10-23 13:12:53 +00:00
Keep Settings in the tvOS sidebar (#986)
tvOS has no other route to Settings, so unchecking it in Sidebar settings locked users out. Treat Settings as a required sidebar item on tvOS; an already-stored hidden value is ignored because required items bypass the visibility map.
This commit is contained in:
@@ -110,6 +110,13 @@ enum SidebarMainItem: String, CaseIterable, Codable, Identifiable, Sendable {
|
||||
switch self {
|
||||
case .search, .home:
|
||||
return true
|
||||
case .settings:
|
||||
// tvOS has no other route to Settings, so hiding it would lock the user out.
|
||||
#if os(tvOS)
|
||||
return true
|
||||
#else
|
||||
return false
|
||||
#endif
|
||||
default:
|
||||
return false
|
||||
}
|
||||
|
||||
@@ -260,7 +260,7 @@ struct SidebarSettingsView: View {
|
||||
|
||||
private func mainItemBinding(for item: SidebarMainItem) -> Binding<Bool> {
|
||||
Binding(
|
||||
get: { mainItemVisibility[item] ?? true },
|
||||
get: { item.isRequired || (mainItemVisibility[item] ?? true) },
|
||||
set: { newValue in
|
||||
mainItemVisibility[item] = newValue
|
||||
saveMainNavigationSettings()
|
||||
|
||||
Reference in New Issue
Block a user