mirror of
https://github.com/yattee/yattee.git
synced 2024-12-22 21:43:41 +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 {
|
||||
Button {
|
||||
guard !inChannelView else {
|
||||
return
|
||||
}
|
||||
@ViewBuilder private func channelButton(badge: Bool = true) -> some View {
|
||||
if !video.channel.name.isEmpty {
|
||||
Button {
|
||||
guard !inChannelView else {
|
||||
return
|
||||
}
|
||||
|
||||
NavigationModel.openChannel(
|
||||
video.channel,
|
||||
player: player,
|
||||
recents: recents,
|
||||
navigation: navigation,
|
||||
navigationStyle: navigationStyle
|
||||
)
|
||||
} label: {
|
||||
if badge {
|
||||
DetailBadge(text: video.author, style: .prominent)
|
||||
.foregroundColor(.primary)
|
||||
} else {
|
||||
Text(video.channel.name)
|
||||
.fontWeight(.semibold)
|
||||
.foregroundColor(.secondary)
|
||||
NavigationModel.openChannel(
|
||||
video.channel,
|
||||
player: player,
|
||||
recents: recents,
|
||||
navigation: navigation,
|
||||
navigationStyle: navigationStyle
|
||||
)
|
||||
} label: {
|
||||
if badge {
|
||||
DetailBadge(text: video.author, style: .prominent)
|
||||
.foregroundColor(.primary)
|
||||
} else {
|
||||
Text(video.channel.name)
|
||||
.fontWeight(.semibold)
|
||||
.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 {
|
||||
|
Loading…
Reference in New Issue
Block a user