From 31e06cd24a5f6e55d3dc3051414c5e7d1de3c5cc Mon Sep 17 00:00:00 2001 From: Maurice Parker Date: Tue, 31 Mar 2020 11:18:52 -0500 Subject: [PATCH] Add batch update block to fetch to prevent the Feeds list from dancing around. --- Frameworks/Account/CloudKit/CloudKitAccountDelegate.swift | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Frameworks/Account/CloudKit/CloudKitAccountDelegate.swift b/Frameworks/Account/CloudKit/CloudKitAccountDelegate.swift index 90443596c..5b1edbabd 100644 --- a/Frameworks/Account/CloudKit/CloudKitAccountDelegate.swift +++ b/Frameworks/Account/CloudKit/CloudKitAccountDelegate.swift @@ -69,14 +69,17 @@ final class CloudKitAccountDelegate: AccountDelegate { } func refreshAll(for account: Account, completion: @escaping (Result) -> Void) { + BatchUpdate.shared.start() accountZone.fetchChangesInZone() { result in switch result { case .success: self.refresher.refreshFeeds(account.flattenedWebFeeds()) { + BatchUpdate.shared.end() account.metadata.lastArticleFetchEndTime = Date() completion(.success(())) } case .failure(let error): + BatchUpdate.shared.end() completion(.failure(error)) } }