Clean activities when the associated data is deleted

This commit is contained in:
Maurice Parker
2019-08-28 11:30:40 -05:00
parent ba9f7ac426
commit 9c66f6160e
4 changed files with 75 additions and 3 deletions

View File

@@ -859,6 +859,12 @@ private extension MasterFeedViewController {
return
}
if let folder = deleteNode.representedObject as? Folder {
ActivityManager.shared.cleanUp(folder)
} else if let feed = deleteNode.representedObject as? Feed {
ActivityManager.shared.cleanUp(feed)
}
var deleteIndexPaths = [indexPath]
if coordinator.isExpanded(deleteNode) {
for i in 0..<deleteNode.numberOfChildNodes {

View File

@@ -114,6 +114,7 @@ struct SettingsDetailAccountView : View {
func delete() {
AccountManager.shared.deleteAccount(account)
ActivityManager.shared.cleanUp(account)
}
}
}

View File

@@ -121,6 +121,7 @@ private extension DetailAccountViewController {
let markAction = UIAlertAction(title: markTitle, style: .default) { [weak self] (action) in
guard let account = self?.account else { return }
AccountManager.shared.deleteAccount(account)
ActivityManager.shared.cleanUp(account)
self?.navigationController?.popViewController(animated: true)
}
alertController.addAction(markAction)