Make delete animation correct for deletes and restores by wrapping them in BatchUpdates. Issue #667
This commit is contained in:
parent
8e7b1c8454
commit
31cc3b609c
|
@ -837,18 +837,14 @@ private extension FeedbinAccountDelegate {
|
|||
|
||||
if editedName != nil {
|
||||
DispatchQueue.main.async {
|
||||
BatchUpdate.shared.perform {
|
||||
account.removeFeed(feed)
|
||||
folder.addFeed(feed)
|
||||
}
|
||||
account.removeFeed(feed)
|
||||
folder.addFeed(feed)
|
||||
}
|
||||
self?.processRestoredFeedName(for: account, feed: feed, editedName: editedName!, completion: completion)
|
||||
} else {
|
||||
DispatchQueue.main.async {
|
||||
BatchUpdate.shared.perform {
|
||||
account.removeFeed(feed)
|
||||
folder.addFeed(feed)
|
||||
}
|
||||
account.removeFeed(feed)
|
||||
folder.addFeed(feed)
|
||||
completion(.success(()))
|
||||
}
|
||||
}
|
||||
|
@ -869,6 +865,10 @@ private extension FeedbinAccountDelegate {
|
|||
|
||||
if editedName != nil {
|
||||
processRestoredFeedName(for: account, feed: feed, editedName: editedName!, completion: completion)
|
||||
} else {
|
||||
DispatchQueue.main.async {
|
||||
completion(.success(()))
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -135,11 +135,15 @@ private struct SidebarItemSpecifier {
|
|||
func delete() {
|
||||
|
||||
if let feed = feed {
|
||||
BatchUpdate.shared.start()
|
||||
account?.deleteFeed(feed) { result in
|
||||
BatchUpdate.shared.end()
|
||||
self.checkResult(result)
|
||||
}
|
||||
} else if let folder = folder {
|
||||
BatchUpdate.shared.start()
|
||||
account?.deleteFolder(folder) { result in
|
||||
BatchUpdate.shared.end()
|
||||
self.checkResult(result)
|
||||
}
|
||||
}
|
||||
|
@ -161,7 +165,9 @@ private struct SidebarItemSpecifier {
|
|||
return
|
||||
}
|
||||
|
||||
BatchUpdate.shared.start()
|
||||
account.restoreFeed(feed, folder: resolvedFolder()) { result in
|
||||
BatchUpdate.shared.end()
|
||||
self.checkResult(result)
|
||||
}
|
||||
|
||||
|
@ -173,7 +179,9 @@ private struct SidebarItemSpecifier {
|
|||
return
|
||||
}
|
||||
|
||||
BatchUpdate.shared.start()
|
||||
account.restoreFolder(folder) { result in
|
||||
BatchUpdate.shared.end()
|
||||
self.checkResult(result)
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue