mirror of
https://github.com/Ranchero-Software/NetNewsWire
synced 2025-08-12 06:26:36 +00:00
Refactor SmartFeedController to find SmartFeeds by FeedIdentifier instead of the string identifier.
This commit is contained in:
@@ -24,14 +24,19 @@ final class SmartFeedsController: DisplayNameProvider {
|
||||
self.smartFeeds = [todayFeed, unreadFeed, starredFeed]
|
||||
}
|
||||
|
||||
func find(by identifier: String) -> PseudoFeed? {
|
||||
func find(by identifier: FeedIdentifier) -> PseudoFeed? {
|
||||
switch identifier {
|
||||
case String(describing: TodayFeedDelegate.self):
|
||||
return todayFeed
|
||||
case String(describing: UnreadFeed.self):
|
||||
return unreadFeed
|
||||
case String(describing: StarredFeedDelegate.self):
|
||||
return starredFeed
|
||||
case .smartFeed(let stringIdentifer):
|
||||
switch stringIdentifer {
|
||||
case String(describing: TodayFeedDelegate.self):
|
||||
return todayFeed
|
||||
case String(describing: UnreadFeed.self):
|
||||
return unreadFeed
|
||||
case String(describing: StarredFeedDelegate.self):
|
||||
return starredFeed
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user