mirror of
https://github.com/Ranchero-Software/NetNewsWire.git
synced 2024-12-25 09:11:13 +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() {
|
func perform() {
|
||||||
|
perform {}
|
||||||
BatchUpdate.shared.perform {
|
|
||||||
itemSpecifiers.forEach { $0.delete() {} }
|
|
||||||
treeController.rebuild()
|
|
||||||
}
|
|
||||||
registerUndo()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func perform(completion: @escaping () -> Void) {
|
func perform(completion: @escaping () -> Void) {
|
||||||
|
|
||||||
let group = DispatchGroup()
|
let group = DispatchGroup()
|
||||||
group.enter()
|
|
||||||
itemSpecifiers.forEach {
|
itemSpecifiers.forEach {
|
||||||
|
group.enter()
|
||||||
$0.delete() {
|
$0.delete() {
|
||||||
group.leave()
|
group.leave()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
treeController.rebuild()
|
|
||||||
|
|
||||||
group.notify(queue: DispatchQueue.main) {
|
group.notify(queue: DispatchQueue.main) {
|
||||||
|
self.treeController.rebuild()
|
||||||
self.registerUndo()
|
self.registerUndo()
|
||||||
completion()
|
completion()
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user