Fetch zone changes immediately after making them to keep us better in sync
This commit is contained in:
parent
4f54a21084
commit
e4f0a87a64
|
@ -632,10 +632,12 @@ private extension CloudKitAccountDelegate {
|
|||
self.articlesZone.deleteArticles(deletedArticles) { _ in
|
||||
self.refreshProgress.completeTask()
|
||||
self.articlesZone.saveNewArticles(newAndUpdatedArticles) { _ in
|
||||
self.articlesZone.fetchChangesInZone() { _ in
|
||||
self.refreshProgress.completeTask()
|
||||
completion()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
@ -684,10 +686,12 @@ private extension CloudKitAccountDelegate {
|
|||
self.articlesZone.deleteArticles(deletedArticles) { _ in
|
||||
self.refreshProgress.completeTask()
|
||||
self.articlesZone.saveNewArticles(newAndUpdatedArticles) { _ in
|
||||
self.articlesZone.fetchChangesInZone() { _ in
|
||||
self.refreshProgress.clear()
|
||||
completion(.success(feed))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
case .failure(let error):
|
||||
self.refreshProgress.clear()
|
||||
|
@ -765,10 +769,12 @@ private extension CloudKitAccountDelegate {
|
|||
self.articlesZone.deleteArticles(deletedArticles) { _ in
|
||||
self.refreshProgress.completeTask()
|
||||
self.articlesZone.saveNewArticles(newAndUpdatedArticles) { _ in
|
||||
self.articlesZone.fetchChangesInZone() { _ in
|
||||
self.refreshProgress.clear()
|
||||
completion(.success(feed))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
case .failure(let error):
|
||||
self.refreshProgress.clear()
|
||||
|
|
|
@ -222,10 +222,12 @@ private extension CloudKitAcountZoneDelegate {
|
|||
self.articlesZone?.deleteArticles(deletedArticles) { _ in
|
||||
self.refreshProgress?.completeTask()
|
||||
self.articlesZone?.saveNewArticles(newAndUpdatedArticles) { _ in
|
||||
self.articlesZone?.fetchChangesInZone() { _ in
|
||||
self.refreshProgress?.completeTask()
|
||||
completion(webFeed)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
case .failure:
|
||||
completion(webFeed)
|
||||
|
@ -265,10 +267,12 @@ private extension CloudKitAcountZoneDelegate {
|
|||
self.articlesZone?.deleteArticles(deletedArticles) { _ in
|
||||
self.refreshProgress?.completeTask()
|
||||
self.articlesZone?.saveNewArticles(newAndUpdatedArticles) { _ in
|
||||
self.articlesZone?.fetchChangesInZone() { _ in
|
||||
self.refreshProgress?.completeTask()
|
||||
completion(webFeed)
|
||||
}
|
||||
}
|
||||
}
|
||||
case .failure:
|
||||
completion(webFeed)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue