From 3089f2332e0c65e9417ef47a16910a079ac102ce Mon Sep 17 00:00:00 2001 From: Kiel Gillard Date: Wed, 9 Oct 2019 19:47:15 +1100 Subject: [PATCH] Show progress while fetching the content of a newly created feed. --- Frameworks/Account/Feedly/FeedlyAccountDelegate.swift | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Frameworks/Account/Feedly/FeedlyAccountDelegate.swift b/Frameworks/Account/Feedly/FeedlyAccountDelegate.swift index 34e596440..591155b60 100644 --- a/Frameworks/Account/Feedly/FeedlyAccountDelegate.swift +++ b/Frameworks/Account/Feedly/FeedlyAccountDelegate.swift @@ -254,7 +254,7 @@ final class FeedlyAccountDelegate: AccountDelegate { progress.addToNumberOfTasksAndRemaining(1) caller.addFeed(with: resourceId, title: name, toCollectionWith: collectionId) { [weak self] result in - progress.completeTask() + defer { progress.completeTask() } switch result { case .success(let feedlyFeeds): @@ -276,6 +276,7 @@ final class FeedlyAccountDelegate: AccountDelegate { } let group = DispatchGroup() + progress.addToNumberOfTasksAndRemaining(1) if let self = self { for feed in added { @@ -299,6 +300,7 @@ final class FeedlyAccountDelegate: AccountDelegate { } group.notify(queue: .main) { + progress.completeTask() completion(.success(first)) }