mirror of
https://github.com/Ranchero-Software/NetNewsWire.git
synced 2025-01-11 09:14:06 +01:00
Make the remove feed process manage the progress indicator better.
This commit is contained in:
parent
449085b84a
commit
116a346b87
@ -302,14 +302,22 @@ final class CloudKitAccountDelegate: AccountDelegate {
|
||||
}
|
||||
|
||||
func removeWebFeed(for account: Account, with feed: WebFeed, from container: Container, completion: @escaping (Result<Void, Error>) -> Void) {
|
||||
refreshProgress.addToNumberOfTasksAndRemaining(1)
|
||||
refreshProgress.addToNumberOfTasksAndRemaining(2)
|
||||
accountZone.removeWebFeed(feed, from: container) { result in
|
||||
self.refreshProgress.completeTask()
|
||||
switch result {
|
||||
case .success(let deleted):
|
||||
container.removeWebFeed(feed)
|
||||
if deleted {
|
||||
self.publicZone.manageSubscriptions(account.flattenedWebFeedURLs, completion: completion)
|
||||
self.publicZone.manageSubscriptions(account.flattenedWebFeedURLs) { result in
|
||||
self.refreshProgress.completeTask()
|
||||
switch result {
|
||||
case .success:
|
||||
completion(.success(()))
|
||||
case .failure(let error):
|
||||
completion(.failure(error))
|
||||
}
|
||||
}
|
||||
} else {
|
||||
completion(.success(()))
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user