mirror of
https://github.com/yattee/yattee.git
synced 2025-08-05 02:04:07 +00:00
Feed count model
This commit is contained in:
@@ -6,6 +6,7 @@ struct ChannelsView: View {
|
||||
@ObservedObject private var feed = FeedModel.shared
|
||||
@ObservedObject private var subscriptions = SubscribedChannelsModel.shared
|
||||
@ObservedObject private var accounts = AccountsModel.shared
|
||||
@ObservedObject private var feedCount = UnwatchedFeedCountModel.shared
|
||||
|
||||
@Default(.showCacheStatus) private var showCacheStatus
|
||||
|
||||
@@ -25,7 +26,7 @@ struct ChannelsView: View {
|
||||
}
|
||||
}
|
||||
.backport
|
||||
.badge(channelBadge(channel))
|
||||
.badge(feedCount.unwatchedByChannelText(channel))
|
||||
}
|
||||
.contextMenu {
|
||||
if subscriptions.isSubscribing(channel.id) {
|
||||
@@ -84,14 +85,6 @@ struct ChannelsView: View {
|
||||
#endif
|
||||
}
|
||||
|
||||
func channelBadge(_ channel: Channel) -> Text? {
|
||||
if let count = feed.unwatchedByChannel[accounts.current]?[channel.id] {
|
||||
return Text(String(count))
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
var header: some View {
|
||||
HStack {
|
||||
#if os(tvOS)
|
||||
|
Reference in New Issue
Block a user