NetNewsWire/Shared/SmartFeeds/TodayFeedDelegate.swift

33 lines
738 B
Swift
Raw Normal View History

//
// TodayFeedDelegate.swift
2018-08-29 07:18:24 +02: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-04-04 05:11:09 +02:00
@MainActor struct TodayFeedDelegate: SmartFeedDelegate {
2024-02-26 06:34:22 +01:00
var sidebarItemID: SidebarItemIdentifier? {
return SidebarItemIdentifier.smartFeed(String(describing: TodayFeedDelegate.self))
}
let nameForDisplay = NSLocalizedString("Today", comment: "Today pseudo-feed title")
let fetchType = FetchType.today(nil)
var smallIcon: IconImage? {
return AppAssets.todayFeedImage
}
2024-03-25 02:49:39 +01:00
func unreadCount(account: Account) async -> Int {
(try? await account.unreadCountForToday()) ?? 0
}
}