widget and unread badge counts are correct
also - counts in the widget revert back to using data available in the SmartFeedsController.
This commit is contained in:
parent
3c2c17df0d
commit
1ca0df67a4
|
@ -49,7 +49,6 @@ public final class WidgetDataEncoder {
|
||||||
feedIcon: article.iconImage()?.image.dataRepresentation(),
|
feedIcon: article.iconImage()?.image.dataRepresentation(),
|
||||||
pubDate: article.datePublished?.description ?? "")
|
pubDate: article.datePublished?.description ?? "")
|
||||||
unread.append(latestArticle)
|
unread.append(latestArticle)
|
||||||
if unread.count == 7 { break }
|
|
||||||
}
|
}
|
||||||
|
|
||||||
for article in starredArticles {
|
for article in starredArticles {
|
||||||
|
@ -60,7 +59,6 @@ public final class WidgetDataEncoder {
|
||||||
feedIcon: article.iconImage()?.image.dataRepresentation(),
|
feedIcon: article.iconImage()?.image.dataRepresentation(),
|
||||||
pubDate: article.datePublished?.description ?? "")
|
pubDate: article.datePublished?.description ?? "")
|
||||||
starred.append(latestArticle)
|
starred.append(latestArticle)
|
||||||
if starred.count == 7 { break }
|
|
||||||
}
|
}
|
||||||
|
|
||||||
for article in todayArticles {
|
for article in todayArticles {
|
||||||
|
@ -71,12 +69,11 @@ public final class WidgetDataEncoder {
|
||||||
feedIcon: article.iconImage()?.image.dataRepresentation(),
|
feedIcon: article.iconImage()?.image.dataRepresentation(),
|
||||||
pubDate: article.datePublished?.description ?? "")
|
pubDate: article.datePublished?.description ?? "")
|
||||||
today.append(latestArticle)
|
today.append(latestArticle)
|
||||||
if today.count == 7 { break }
|
|
||||||
}
|
}
|
||||||
|
|
||||||
let latestData = WidgetData(currentUnreadCount: try! AccountManager.shared.fetchArticles(.unread()).count,
|
let latestData = WidgetData(currentUnreadCount: SmartFeedsController.shared.unreadFeed.unreadCount,
|
||||||
currentTodayCount: try! AccountManager.shared.fetchArticles(.today()).count,
|
currentTodayCount: SmartFeedsController.shared.todayFeed.unreadCount,
|
||||||
currentStarredCount: try! AccountManager.shared.fetchArticles(.starred()).count,
|
currentStarredCount: try! SmartFeedsController.shared.starredFeed.fetchArticles().count,
|
||||||
unreadArticles: unread,
|
unreadArticles: unread,
|
||||||
starredArticles: starred,
|
starredArticles: starred,
|
||||||
todayArticles:today,
|
todayArticles:today,
|
||||||
|
|
Loading…
Reference in New Issue