From 99ffaed5fc9eb26f1aadfaa1649d5ca6da0f1464 Mon Sep 17 00:00:00 2001 From: Arkadiusz Fal Date: Sat, 22 Jul 2023 19:20:46 +0200 Subject: [PATCH] Honor "Keep channels with unwatched videos on top of subscriptions list" setting in sidebar --- Shared/Navigation/AppSidebarSubscriptions.swift | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Shared/Navigation/AppSidebarSubscriptions.swift b/Shared/Navigation/AppSidebarSubscriptions.swift index d88ff831..0bc53db5 100644 --- a/Shared/Navigation/AppSidebarSubscriptions.swift +++ b/Shared/Navigation/AppSidebarSubscriptions.swift @@ -16,7 +16,7 @@ struct AppSidebarSubscriptions: View { var body: some View { Section(header: Text("Subscriptions")) { - ForEach(subscriptions.all) { channel in + ForEach(channels) { channel in NavigationLink(tag: TabSelection.channel(channel.id), selection: $navigation.tabSelection) { LazyView(ChannelVideosView(channel: channel)) } label: { @@ -44,6 +44,10 @@ struct AppSidebarSubscriptions: View { } } } + + var channels: [Channel] { + keepChannelsWithUnwatchedFeedOnTop ? subscriptions.allByUnwatchedCount : subscriptions.all + } } struct AppSidebarSubscriptions_Previews: PreviewProvider {