only show some items if there are items
This commit is contained in:
parent
3359340449
commit
4c59bfcf9d
|
@ -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
|
||||||
|
|
Loading…
Reference in New Issue