mirror of
https://github.com/Ranchero-Software/NetNewsWire.git
synced 2024-12-25 01:01:21 +01:00
Change so that the tree controller can't be rebuilt before all async deletes have completed. Issue #1002
This commit is contained in:
parent
66ce3db1fc
commit
7c060bb068
@ -44,26 +44,21 @@ final class DeleteCommand: UndoableCommand {
|
||||
}
|
||||
|
||||
func perform() {
|
||||
|
||||
BatchUpdate.shared.perform {
|
||||
itemSpecifiers.forEach { $0.delete() {} }
|
||||
treeController.rebuild()
|
||||
}
|
||||
registerUndo()
|
||||
perform {}
|
||||
}
|
||||
|
||||
func perform(completion: @escaping () -> Void) {
|
||||
|
||||
let group = DispatchGroup()
|
||||
group.enter()
|
||||
itemSpecifiers.forEach {
|
||||
group.enter()
|
||||
$0.delete() {
|
||||
group.leave()
|
||||
}
|
||||
}
|
||||
treeController.rebuild()
|
||||
|
||||
group.notify(queue: DispatchQueue.main) {
|
||||
self.treeController.rebuild()
|
||||
self.registerUndo()
|
||||
completion()
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user