Remove initial send status since we do it at the end now

This commit is contained in:
Maurice Parker 2020-04-29 23:56:50 -05:00
parent d27b0cb2a0
commit c9ad5fe4c0
1 changed files with 8 additions and 22 deletions

View File

@ -573,7 +573,7 @@ private extension CloudKitAccountDelegate {
func standardRefreshAll(for account: Account, completion: @escaping (Result<Void, Error>) -> Void) {
let intialWebFeedsCount = account.flattenedWebFeeds().count
refreshProgress.addToNumberOfTasksAndRemaining(4 + intialWebFeedsCount)
refreshProgress.addToNumberOfTasksAndRemaining(3 + intialWebFeedsCount)
func fail(_ error: Error) {
self.processAccountError(account, error)
@ -585,37 +585,23 @@ private extension CloudKitAccountDelegate {
switch result {
case .success:
self.refreshProgress.completeTask()
let webFeeds = account.flattenedWebFeeds()
self.refreshProgress.addToNumberOfTasksAndRemaining(webFeeds.count - intialWebFeedsCount)
self.refreshProgress.completeTask()
self.sendArticleStatus(for: account) { result in
self.refreshArticleStatus(for: account) { result in
switch result {
case .success:
self.refreshProgress.completeTask()
self.refreshArticleStatus(for: account) { result in
switch result {
case .success:
self.refreshProgress.completeTask()
self.combinedRefresh(account, webFeeds) {
self.refreshProgress.clear()
account.metadata.lastArticleFetchEndTime = Date()
}
case .failure(let error):
fail(error)
}
self.combinedRefresh(account, webFeeds) {
self.refreshProgress.clear()
account.metadata.lastArticleFetchEndTime = Date()
}
case .failure(let error):
fail(error)
}
}
case .failure(let error):
fail(error)
}