From 4a2760ade3a11a6248dde36e1b1af3a7f88eb6c3 Mon Sep 17 00:00:00 2001 From: Maurice Parker Date: Fri, 3 Apr 2020 17:29:26 -0500 Subject: [PATCH] Fix bug that could cause the progress indicator to not finish. --- Frameworks/Account/CloudKit/CloudKitAccountDelegate.swift | 1 + Frameworks/Account/LocalAccount/LocalAccountRefresher.swift | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/Frameworks/Account/CloudKit/CloudKitAccountDelegate.swift b/Frameworks/Account/CloudKit/CloudKitAccountDelegate.swift index 86aaafdff..291530123 100644 --- a/Frameworks/Account/CloudKit/CloudKitAccountDelegate.swift +++ b/Frameworks/Account/CloudKit/CloudKitAccountDelegate.swift @@ -507,6 +507,7 @@ private extension CloudKitAccountDelegate { self.refresher.refreshFeeds(webFeeds, feedCompletionBlock: { _ in self.refreshProgress.completeTask() }) { account.metadata.lastArticleFetchEndTime = Date() + self.refreshProgress.clear() completion(.success(())) } diff --git a/Frameworks/Account/LocalAccount/LocalAccountRefresher.swift b/Frameworks/Account/LocalAccount/LocalAccountRefresher.swift index 1823e0bb1..28c8fa47e 100644 --- a/Frameworks/Account/LocalAccount/LocalAccountRefresher.swift +++ b/Frameworks/Account/LocalAccount/LocalAccountRefresher.swift @@ -107,7 +107,9 @@ extension LocalAccountRefresher: DownloadSessionDelegate { } func downloadSession(_ downloadSession: DownloadSession, shouldContinueAfterReceivingData data: Data, representedObject: AnyObject) -> Bool { - guard !isSuspended, let feed = representedObject as? WebFeed else { + let feed = representedObject as! WebFeed + guard !isSuspended else { + feedCompletionBlock?(feed) return false }