From d58026bcef62f492a7d4d5641835faab6cd60f28 Mon Sep 17 00:00:00 2001 From: Arkadiusz Fal Date: Sun, 26 Feb 2023 19:14:06 +0100 Subject: [PATCH] Fix favorite channel button on tvOS --- Shared/Channels/ChannelVideosView.swift | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/Shared/Channels/ChannelVideosView.swift b/Shared/Channels/ChannelVideosView.swift index 01286c2b..6232fea5 100644 --- a/Shared/Channels/ChannelVideosView.swift +++ b/Shared/Channels/ChannelVideosView.swift @@ -63,6 +63,8 @@ struct ChannelVideosView: View { viewsLabel subscriptionToggleButton + favoriteButton + .labelStyle(.iconOnly) } contentTypePicker .pickerStyle(.automatic) @@ -159,9 +161,7 @@ struct ChannelVideosView: View { } ToolbarItem { - if let presentedChannel { - FavoriteButton(item: FavoriteItem(section: .channel(accounts.app.appType.rawValue, presentedChannel.id, presentedChannel.name))) - } + favoriteButton } ToolbarItem { @@ -211,6 +211,12 @@ struct ChannelVideosView: View { } } + @ViewBuilder var favoriteButton: some View { + if let presentedChannel { + FavoriteButton(item: FavoriteItem(section: .channel(accounts.app.appType.rawValue, presentedChannel.id, presentedChannel.name))) + } + } + var thumbnail: some View { ChannelAvatarView(channel: store.item) #if os(tvOS)