only show some items if there are items

This commit is contained in:
Ethan Pippin 2022-01-10 22:46:42 -07:00
parent 3359340449
commit 4c59bfcf9d
1 changed files with 9 additions and 7 deletions

View File

@ -63,12 +63,14 @@ struct ItemViewBody: View {
// MARK: Genres // MARK: Genres
PillHStackView(title: L10n.genres, if let genres = viewModel.item.genreItems {
items: viewModel.item.genreItems ?? [], PillHStackView(title: L10n.genres,
selectedAction: { genre in items: genres,
itemRouter.route(to: \.library, (viewModel: .init(genre: genre), title: genre.title)) selectedAction: { genre in
}) itemRouter.route(to: \.library, (viewModel: .init(genre: genre), title: genre.title))
.padding(.bottom) })
.padding(.bottom)
}
// MARK: Studios // MARK: Studios
@ -118,7 +120,7 @@ struct ItemViewBody: View {
// MARK: Cast & Crew // MARK: Cast & Crew
if showCastAndCrew { if showCastAndCrew {
if let castAndCrew = viewModel.item.people { if let castAndCrew = viewModel.item.people, castAndCrew.count > 0 {
PortraitImageHStackView(items: castAndCrew.filter { BaseItemPerson.DisplayedType.allCasesRaw.contains($0.type ?? "") }, PortraitImageHStackView(items: castAndCrew.filter { BaseItemPerson.DisplayedType.allCasesRaw.contains($0.type ?? "") },
topBarView: { topBarView: {
L10n.castAndCrew.text L10n.castAndCrew.text