Refactor hide shorts

This commit is contained in:
Arkadiusz Fal
2023-05-23 18:54:53 +02:00
parent 1e23809359
commit 50e1491990
11 changed files with 25 additions and 47 deletions

View File

@@ -10,7 +10,6 @@ struct ChannelPlaylistView: View {
@Environment(\.colorScheme) private var colorScheme
@Default(.channelPlaylistListingStyle) private var channelPlaylistListingStyle
@Default(.hideShorts) private var hideShorts
@ObservedObject private var accounts = AccountsModel.shared
var player = PlayerModel.shared
@@ -103,7 +102,7 @@ struct ChannelPlaylistView: View {
HStack {
ListingStyleButtons(listingStyle: $channelPlaylistListingStyle)
HideWatchedButtons()
HideShortsButtons(hide: $hideShorts)
HideShortsButtons()
ShareButton(contentItem: contentItem)
favoriteButton
@@ -133,7 +132,7 @@ struct ChannelPlaylistView: View {
Section {
HideWatchedButtons()
HideShortsButtons(hide: $hideShorts)
HideShortsButtons()
}
Section {

View File

@@ -30,7 +30,6 @@ struct ChannelVideosView: View {
@Default(.channelPlaylistListingStyle) private var channelPlaylistListingStyle
@Default(.expandChannelDescription) private var expandChannelDescription
@Default(.hideShorts) private var hideShorts
var presentedChannel: Channel? {
store.item?.channel ?? channel ?? recents.presentedChannel
@@ -98,7 +97,6 @@ struct ChannelVideosView: View {
.environment(\.loadMoreContentHandler) { loadNextPage() }
.environment(\.inChannelView, true)
.environment(\.listingStyle, channelPlaylistListingStyle)
.environment(\.hideShorts, hideShorts)
#if os(tvOS)
.prefersDefaultFocus(in: focusNamespace)
#endif
@@ -138,7 +136,7 @@ struct ChannelVideosView: View {
ListingStyleButtons(listingStyle: $channelPlaylistListingStyle)
HideWatchedButtons()
HideShortsButtons(hide: $hideShorts)
HideShortsButtons()
contentTypePicker
}
@@ -283,7 +281,7 @@ struct ChannelVideosView: View {
Section {
HideWatchedButtons()
HideShortsButtons(hide: $hideShorts)
HideShortsButtons()
}
}
} label: {