Merge pull request #2594 from stuartbreckenridge/main
changes the behaviour of the today widget
This commit is contained in:
commit
43a8c86822
|
@ -50,7 +50,7 @@ struct WidgetDataEncoder {
|
|||
}
|
||||
|
||||
// Today Articles
|
||||
let todayArticles = try SmartFeedsController.shared.todayFeed.fetchArticles().sorted(by: { $0.datePublished ?? .distantPast > $1.datePublished ?? .distantPast })
|
||||
let todayArticles = try SmartFeedsController.shared.todayFeed.fetchUnreadArticles().sorted(by: { $0.datePublished ?? .distantPast > $1.datePublished ?? .distantPast })
|
||||
var today = [LatestArticle]()
|
||||
for article in todayArticles {
|
||||
let latestArticle = LatestArticle(id: article.sortableArticleID,
|
||||
|
@ -64,7 +64,7 @@ struct WidgetDataEncoder {
|
|||
}
|
||||
|
||||
let latestData = WidgetData(currentUnreadCount: SmartFeedsController.shared.unreadFeed.unreadCount,
|
||||
currentTodayCount: try! SmartFeedsController.shared.todayFeed.fetchArticles().count,
|
||||
currentTodayCount: try! SmartFeedsController.shared.todayFeed.fetchUnreadArticles().count,
|
||||
currentStarredCount: try! SmartFeedsController.shared.starredFeed.fetchArticles().count,
|
||||
unreadArticles: unread,
|
||||
starredArticles: starred,
|
||||
|
|
|
@ -51,9 +51,9 @@
|
|||
<key>zero</key>
|
||||
<string>No more recent articles</string>
|
||||
<key>one</key>
|
||||
<string>+ 1 more recent article</string>
|
||||
<string>+ 1 more recent unread article</string>
|
||||
<key>other</key>
|
||||
<string>+ %u more recent articles</string>
|
||||
<string>+ %u more recent unread articles</string>
|
||||
</dict>
|
||||
</dict>
|
||||
</dict>
|
||||
|
|
|
@ -41,7 +41,7 @@ struct TodayWidget: Widget {
|
|||
|
||||
})
|
||||
.configurationDisplayName("Your Today Articles")
|
||||
.description("A sneak peak at recently published articles.")
|
||||
.description("A sneak peak at unread recently published articles.")
|
||||
.supportedFamilies([.systemMedium, .systemLarge])
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue