mirror of
https://github.com/yattee/yattee.git
synced 2025-08-09 20:24:06 +00:00
Feed count model
This commit is contained in:
@@ -4,8 +4,8 @@ import SwiftUI
|
||||
struct AppSidebarSubscriptions: View {
|
||||
@ObservedObject private var navigation = NavigationModel.shared
|
||||
@ObservedObject private var feed = FeedModel.shared
|
||||
@ObservedObject private var feedCount = UnwatchedFeedCountModel.shared
|
||||
@ObservedObject private var subscriptions = SubscribedChannelsModel.shared
|
||||
|
||||
@ObservedObject private var accounts = AccountsModel.shared
|
||||
|
||||
var body: some View {
|
||||
@@ -23,9 +23,9 @@ struct AppSidebarSubscriptions: View {
|
||||
} else {
|
||||
Label(channel.name, systemImage: RecentsModel.symbolSystemImage(channel.name))
|
||||
}
|
||||
|
||||
feedCount.unwatchedByChannelText(channel)
|
||||
}
|
||||
.backport
|
||||
.badge(channelBadge(channel))
|
||||
}
|
||||
.contextMenu {
|
||||
if subscriptions.isSubscribing(channel.id) {
|
||||
@@ -41,14 +41,6 @@ struct AppSidebarSubscriptions: View {
|
||||
}
|
||||
}
|
||||
|
||||
func channelBadge(_ channel: Channel) -> Text? {
|
||||
if let count = feed.unwatchedByChannel[accounts.current]?[channel.id] {
|
||||
return Text(String(count))
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
@ViewBuilder func toggleWatchedButton(_ channel: Channel) -> some View {
|
||||
if feed.canMarkChannelAsWatched(channel.id) {
|
||||
markChannelAsWatchedButton(channel)
|
||||
|
Reference in New Issue
Block a user