Fix visible tvOS sections

This commit is contained in:
Arkadiusz Fal 2022-11-15 15:27:23 +01:00
parent 78ff495927
commit 66c9fa773c

View File

@ -17,28 +17,30 @@ struct TVNavigationView: View {
.tabItem { Text("Home") } .tabItem { Text("Home") }
.tag(TabSelection.home) .tag(TabSelection.home)
if visibleSections.contains(.subscriptions), accounts.app.supportsSubscriptions, accounts.api.signedIn { if !accounts.isEmpty {
LazyView(SubscriptionsView()) if visibleSections.contains(.subscriptions), accounts.app.supportsSubscriptions, accounts.api.signedIn {
.tabItem { Text("Subscriptions") } LazyView(SubscriptionsView())
.tag(TabSelection.subscriptions) .tabItem { Text("Subscriptions") }
} .tag(TabSelection.subscriptions)
}
if visibleSections.contains(.popular), accounts.app.supportsPopular {
LazyView(PopularView()) if visibleSections.contains(.popular), accounts.app.supportsPopular {
.tabItem { Text("Popular") } LazyView(PopularView())
.tag(TabSelection.popular) .tabItem { Text("Popular") }
} .tag(TabSelection.popular)
}
if visibleSections.contains(.trending) {
LazyView(TrendingView()) if visibleSections.contains(.trending) {
.tabItem { Text("Trending") } LazyView(TrendingView())
.tag(TabSelection.trending) .tabItem { Text("Trending") }
} .tag(TabSelection.trending)
}
if visibleSections.contains(.playlists), accounts.app.supportsUserPlaylists, accounts.signedIn {
LazyView(PlaylistsView()) if visibleSections.contains(.playlists), accounts.app.supportsUserPlaylists, accounts.signedIn {
.tabItem { Text("Playlists") } LazyView(PlaylistsView())
.tag(TabSelection.playlists) .tabItem { Text("Playlists") }
.tag(TabSelection.playlists)
}
} }
LazyView(NowPlayingView()) LazyView(NowPlayingView())