Fix bug that could cause the progress indicator to not finish.

This commit is contained in:
Maurice Parker 2020-04-03 17:29:26 -05:00
parent c454aa88b8
commit 4a2760ade3
2 changed files with 4 additions and 1 deletions

View File

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

View File

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