Find HTML images before updating rows when a timeline thumbnail fails.

This commit is contained in:
Brent Simmons committed 2026-10-30 17:52:02 -07:00
1 parent 262c8f16dc
commit 3da931b856
2 files changed
+7 -11

No files matched your search

@@ -1264,15 +1264,12 @@ private extension MainTimelineViewController {
guard thumbnailMode != nil, let articleIDs = notification.userInfo?[ArticleThumbnailFinder.articleIDsKey] as? Set<String> else {
return
}
// Articles that used the failed URL now get their next source, or none.
thumbnailURLsDidChange(for: articleIDs)
// A failed provided image falls back to images in the HTML.
guard let articlesUsingURL = articles?.filter({ articleIDs.contains($0.articleID) }) else {
return
}
// A failed provided image falls back to images in the HTML. Those are found first, so a row that has one doesn’t shrink and then grow back.
let articlesUsingURL = articles?.filter { articleIDs.contains($0.articleID) } ?? []
Task {
await ArticleThumbnailFinder.shared.discoverThumbnailURLs(for: articlesUsingURL)
// Articles that used the failed URL now get their next source, or none.
thumbnailURLsDidChange(for: articleIDs)
}
}