mirror of
https://github.com/yattee/yattee.git
synced 2025-05-18 04:21:08 +00:00
Don't show empty channel button
This commit is contained in:
parent
a1ade66594
commit
59eda3af26
@ -303,35 +303,37 @@ struct VideoCell: View {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private func channelButton(badge: Bool = true) -> some View {
|
@ViewBuilder private func channelButton(badge: Bool = true) -> some View {
|
||||||
Button {
|
if !video.channel.name.isEmpty {
|
||||||
guard !inChannelView else {
|
Button {
|
||||||
return
|
guard !inChannelView else {
|
||||||
}
|
return
|
||||||
|
}
|
||||||
|
|
||||||
NavigationModel.openChannel(
|
NavigationModel.openChannel(
|
||||||
video.channel,
|
video.channel,
|
||||||
player: player,
|
player: player,
|
||||||
recents: recents,
|
recents: recents,
|
||||||
navigation: navigation,
|
navigation: navigation,
|
||||||
navigationStyle: navigationStyle
|
navigationStyle: navigationStyle
|
||||||
)
|
)
|
||||||
} label: {
|
} label: {
|
||||||
if badge {
|
if badge {
|
||||||
DetailBadge(text: video.author, style: .prominent)
|
DetailBadge(text: video.author, style: .prominent)
|
||||||
.foregroundColor(.primary)
|
.foregroundColor(.primary)
|
||||||
} else {
|
} else {
|
||||||
Text(video.channel.name)
|
Text(video.channel.name)
|
||||||
.fontWeight(.semibold)
|
.fontWeight(.semibold)
|
||||||
.foregroundColor(.secondary)
|
.foregroundColor(.secondary)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
#if os(tvOS)
|
||||||
|
.buttonStyle(.card)
|
||||||
|
#else
|
||||||
|
.buttonStyle(.plain)
|
||||||
|
#endif
|
||||||
|
.help("\(video.channel.name) Channel")
|
||||||
}
|
}
|
||||||
#if os(tvOS)
|
|
||||||
.buttonStyle(.card)
|
|
||||||
#else
|
|
||||||
.buttonStyle(.plain)
|
|
||||||
#endif
|
|
||||||
.help("\(video.channel.name) Channel")
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private var additionalDetailsAvailable: Bool {
|
private var additionalDetailsAvailable: Bool {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user