mirror of
https://github.com/Ranchero-Software/NetNewsWire.git
synced 2025-02-03 12:27:32 +01:00
Return to main queue after getting notified of the dispatch group completion. Fixes #2863
This commit is contained in:
parent
c9807a6bb0
commit
64e5a09ac6
@ -310,20 +310,22 @@ final class CloudKitAccountDelegate: AccountDelegate {
|
||||
}
|
||||
|
||||
group.notify(queue: DispatchQueue.global(qos: .background)) {
|
||||
guard !errorOccurred else {
|
||||
self.refreshProgress.completeTask()
|
||||
completion(.failure(CloudKitAccountDelegateError.unknown))
|
||||
return
|
||||
}
|
||||
|
||||
self.accountZone.removeFolder(folder) { result in
|
||||
self.refreshProgress.completeTask()
|
||||
switch result {
|
||||
case .success:
|
||||
account.removeFolder(folder)
|
||||
completion(.success(()))
|
||||
case .failure(let error):
|
||||
completion(.failure(error))
|
||||
DispatchQueue.main.async {
|
||||
guard !errorOccurred else {
|
||||
self.refreshProgress.completeTask()
|
||||
completion(.failure(CloudKitAccountDelegateError.unknown))
|
||||
return
|
||||
}
|
||||
|
||||
self.accountZone.removeFolder(folder) { result in
|
||||
self.refreshProgress.completeTask()
|
||||
switch result {
|
||||
case .success:
|
||||
account.removeFolder(folder)
|
||||
completion(.success(()))
|
||||
case .failure(let error):
|
||||
completion(.failure(error))
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user