NetNewsWire/Shared/SmartFeeds/StarredFeedDelegate.swift

32 lines
763 B
Swift
Raw Normal View History

//
// StarredFeedDelegate.swift
2018-08-28 22:18:24 -07:00
// NetNewsWire
//
// Created by Brent Simmons on 11/19/17.
// Copyright © 2017 Ranchero Software. All rights reserved.
//
import Foundation
import Articles
import ArticlesDatabase
import Account
import Images
2024-03-25 12:48:02 -07:00
@MainActor struct StarredFeedDelegate: SmartFeedDelegate {
2024-02-25 21:34:22 -08:00
var sidebarItemID: SidebarItemIdentifier? {
return SidebarItemIdentifier.smartFeed(String(describing: StarredFeedDelegate.self))
}
let nameForDisplay = NSLocalizedString("Starred", comment: "Starred pseudo-feed title")
let fetchType: FetchType = .starred(nil)
var smallIcon: IconImage? {
return AppAssets.starredFeedImage
}
2024-03-24 18:49:39 -07:00
func unreadCount(account: Account) async -> Int {
(try? await account.unreadCountForStarredArticles()) ?? 0
}
}