Remove batch update commands that were interfering with the Sidebar getting rebuilt

This commit is contained in:
Maurice Parker 2021-03-15 17:49:33 -05:00
parent f1e4d70481
commit 5fd4dae3e6
1 changed files with 0 additions and 6 deletions

View File

@ -668,7 +668,6 @@ private extension CloudKitAccountDelegate {
}
func createRSSWebFeed(for account: Account, url: URL, editedName: String?, container: Container, completion: @escaping (Result<WebFeed, Error>) -> Void) {
BatchUpdate.shared.start()
refreshProgress.addToNumberOfTasksAndRemaining(5)
FeedFinder.find(url: url) { result in
@ -676,14 +675,12 @@ private extension CloudKitAccountDelegate {
switch result {
case .success(let feedSpecifiers):
guard let bestFeedSpecifier = FeedSpecifier.bestFeed(in: feedSpecifiers), let url = URL(string: bestFeedSpecifier.urlString) else {
BatchUpdate.shared.end()
self.refreshProgress.completeTasks(4)
completion(.failure(AccountError.createErrorNotFound))
return
}
if account.hasWebFeed(withURL: bestFeedSpecifier.urlString) {
BatchUpdate.shared.end()
self.refreshProgress.completeTasks(4)
completion(.failure(AccountError.createErrorAlreadySubscribed))
return
@ -700,7 +697,6 @@ private extension CloudKitAccountDelegate {
account.update(feed, with: parsedFeed) { result in
switch result {
case .success:
BatchUpdate.shared.end()
self.accountZone.createWebFeed(url: bestFeedSpecifier.urlString,
name: parsedFeed.title,
@ -724,7 +720,6 @@ private extension CloudKitAccountDelegate {
}
case .failure(let error):
BatchUpdate.shared.end()
self.refreshProgress.completeTasks(3)
completion(.failure(error))
}
@ -738,7 +733,6 @@ private extension CloudKitAccountDelegate {
}
case .failure:
BatchUpdate.shared.end()
self.refreshProgress.completeTasks(4)
completion(.failure(AccountError.createErrorNotFound))
}