Add browsing setting for unwatched feed

Fix #383
This commit is contained in:
Arkadiusz Fal
2023-02-28 21:17:12 +01:00
parent b9ad5bc633
commit f8d79bb08c
8 changed files with 19 additions and 6 deletions

View File

@@ -8,6 +8,8 @@ struct AppSidebarSubscriptions: View {
@ObservedObject private var subscriptions = SubscribedChannelsModel.shared
@ObservedObject private var accounts = AccountsModel.shared
@Default(.showUnwatchedFeedBadges) private var showUnwatchedFeedBadges
var body: some View {
Section(header: Text("Subscriptions")) {
ForEach(subscriptions.all) { channel in
@@ -26,7 +28,7 @@ struct AppSidebarSubscriptions: View {
Spacer()
}
.backport
.badge(feedCount.unwatchedByChannelText(channel))
.badge(showUnwatchedFeedBadges ? feedCount.unwatchedByChannelText(channel) : nil)
}
.contextMenu {
if subscriptions.isSubscribing(channel.id) {

View File

@@ -13,6 +13,7 @@ struct AppTabNavigation: View {
@Default(.showDocuments) private var showDocuments
@Default(.showOpenActionsToolbarItem) private var showOpenActionsToolbarItem
@Default(.visibleSections) private var visibleSections
@Default(.showUnwatchedFeedBadges) private var showUnwatchedFeedBadges
let persistenceController = PersistenceController.shared
@@ -95,7 +96,7 @@ struct AppTabNavigation: View {
}
.tag(TabSelection.subscriptions)
.backport
.badge(feedCount.unwatchedText)
.badge(showUnwatchedFeedBadges ? feedCount.unwatchedText : nil)
}
private var subscriptionsVisible: Bool {

View File

@@ -12,6 +12,7 @@ struct Sidebar: View {
#if os(iOS)
@Default(.showDocuments) private var showDocuments
#endif
@Default(.showUnwatchedFeedBadges) private var showUnwatchedFeedBadges
var body: some View {
ScrollViewReader { scrollView in
@@ -79,7 +80,7 @@ struct Sidebar: View {
.accessibility(label: Text("Subscriptions"))
}
.backport
.badge(feedCount.unwatchedText)
.badge(showUnwatchedFeedBadges ? feedCount.unwatchedText : nil)
.contextMenu {
playUnwatchedButton
toggleWatchedButton