Convert moveFeed to async await.

This commit is contained in:
Brent Simmons
2024-04-02 20:17:03 -07:00
parent 3e37388604
commit 323d0404f2
10 changed files with 97 additions and 22 deletions

View File

@@ -104,12 +104,14 @@ extension SidebarViewController: UITableViewDropDelegate {
guard sourceContainer !== destinationContainer else { return }
BatchUpdate.shared.start()
sourceContainer.account?.moveFeed(feed, from: sourceContainer, to: destinationContainer) { result in
BatchUpdate.shared.end()
switch result {
case .success:
break
case .failure(let error):
Task { @MainActor in
do {
try await sourceContainer.account?.moveFeed(feed, from: sourceContainer, to: destinationContainer)
BatchUpdate.shared.end()
} catch {
BatchUpdate.shared.end()
self.presentError(error)
}
}