Merge pull request #2594 from stuartbreckenridge/main

changes the behaviour of the today widget
This commit is contained in:
Maurice Parker 2020-11-19 06:42:53 -06:00 committed by GitHub
commit 43a8c86822
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 5 deletions

View File

@ -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,

View File

@ -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>

View File

@ -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])
}