From 7908c801bf7c97fa7cca9ef78cf51b33fb853e6a Mon Sep 17 00:00:00 2001 From: Brent Simmons Date: Thu, 12 Nov 2026 13:59:08 -0800 Subject: [PATCH] Allow thumbnail downloading when in low data mode. --- Mac/MainWindow/Timeline/TimelineViewController.swift | 2 +- Modules/Images/Sources/Images/DownloadedImageCache.swift | 9 +++++++-- iOS/MainTimeline/MainTimelineViewController.swift | 2 +- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/Mac/MainWindow/Timeline/TimelineViewController.swift b/Mac/MainWindow/Timeline/TimelineViewController.swift index 7603d0109..e3f9b9d8d 100644 --- a/Mac/MainWindow/Timeline/TimelineViewController.swift +++ b/Mac/MainWindow/Timeline/TimelineViewController.swift @@ -842,7 +842,7 @@ final class TimelineViewController: NSViewController, UndoableCommandRunner, Unr // After ArticleThumbnailFinder forgets its choices, which it does on this notification too. Task { @MainActor in remeasureRowsWhoseThumbnailChanged() - // Thumbnails that couldn’t download while offline or in Low Data Mode try again. + // Thumbnails that couldn’t download while offline try again. if ThumbnailDownloader.shared.networkAllowsDownloads { reloadVisibleCells() } diff --git a/Modules/Images/Sources/Images/DownloadedImageCache.swift b/Modules/Images/Sources/Images/DownloadedImageCache.swift index d2ba975f8..d446546ff 100644 --- a/Modules/Images/Sources/Images/DownloadedImageCache.swift +++ b/Modules/Images/Sources/Images/DownloadedImageCache.swift @@ -100,8 +100,13 @@ extension Notification.Name { } } - /// False when offline or in Low Data Mode. + /// False when offline. Low Data Mode doesn’t stop thumbnail downloads. static var networkAllowsDownloads: Bool { + NetworkMonitor.shared.isConnected + } + + /// False when offline or in Low Data Mode. + static var networkAllowsRevalidation: Bool { NetworkMonitor.shared.isConnected && !NetworkMonitor.shared.isConstrained } @@ -379,7 +384,7 @@ private extension DownloadedImageCache { /// Doesn’t use the download queue, since icons aren’t limited either. /// A network that doesn’t allow downloads, a retry wait, or a network error leaves `nextCheck` as is, so the next day’s use tries again. func revalidateIfDue(_ url: String) async { - guard Self.networkAllowsDownloads, !isWaitingToRetry(url) else { + guard Self.networkAllowsRevalidation, !isWaitingToRetry(url) else { return } // Not <=, which is back-deployed and crashes on iOS 27.2 betas. diff --git a/iOS/MainTimeline/MainTimelineViewController.swift b/iOS/MainTimeline/MainTimelineViewController.swift index ba4404cb3..9e86e5455 100644 --- a/iOS/MainTimeline/MainTimelineViewController.swift +++ b/iOS/MainTimeline/MainTimelineViewController.swift @@ -1255,7 +1255,7 @@ private extension MainTimelineViewController { guard thumbnailMode != nil, ThumbnailDownloader.shared.networkAllowsDownloads else { return } - // Thumbnails that couldn’t download while offline or in Low Data Mode try again. + // Thumbnails that couldn’t download while offline try again. reloadVisibleCells() }