Add batch update block to fetch to prevent the Feeds list from dancing around.
This commit is contained in:
parent
1be5dc8a54
commit
31e06cd24a
|
@ -69,14 +69,17 @@ final class CloudKitAccountDelegate: AccountDelegate {
|
||||||
}
|
}
|
||||||
|
|
||||||
func refreshAll(for account: Account, completion: @escaping (Result<Void, Error>) -> Void) {
|
func refreshAll(for account: Account, completion: @escaping (Result<Void, Error>) -> Void) {
|
||||||
|
BatchUpdate.shared.start()
|
||||||
accountZone.fetchChangesInZone() { result in
|
accountZone.fetchChangesInZone() { result in
|
||||||
switch result {
|
switch result {
|
||||||
case .success:
|
case .success:
|
||||||
self.refresher.refreshFeeds(account.flattenedWebFeeds()) {
|
self.refresher.refreshFeeds(account.flattenedWebFeeds()) {
|
||||||
|
BatchUpdate.shared.end()
|
||||||
account.metadata.lastArticleFetchEndTime = Date()
|
account.metadata.lastArticleFetchEndTime = Date()
|
||||||
completion(.success(()))
|
completion(.success(()))
|
||||||
}
|
}
|
||||||
case .failure(let error):
|
case .failure(let error):
|
||||||
|
BatchUpdate.shared.end()
|
||||||
completion(.failure(error))
|
completion(.failure(error))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue