Auto expand accounts that may have been suspended as collapsed when disclosing a feed. Issue #1440
This commit is contained in:
parent
3a33c38d5c
commit
8fb92e119a
|
@ -548,9 +548,10 @@ class MasterFeedViewController: UITableViewController, UndoableCommandRunner {
|
|||
}
|
||||
}
|
||||
|
||||
func discloseFeed(_ feed: WebFeed, animated: Bool, completion: (() -> Void)? = nil) {
|
||||
func discloseFeed(_ webFeed: WebFeed, animated: Bool, completion: (() -> Void)? = nil) {
|
||||
|
||||
guard let node = coordinator.rootNode.descendantNodeRepresentingObject(feed as AnyObject) else {
|
||||
func discloseFeedInAccount() {
|
||||
guard let node = coordinator.rootNode.descendantNodeRepresentingObject(webFeed as AnyObject) else {
|
||||
completion?()
|
||||
return
|
||||
}
|
||||
|
@ -571,13 +572,28 @@ class MasterFeedViewController: UITableViewController, UndoableCommandRunner {
|
|||
coordinator.expand(parent)
|
||||
reloadNode(parent)
|
||||
|
||||
self.applyChanges(animated: true, adjustScroll: true) { [weak self] in
|
||||
applyChanges(animated: true, adjustScroll: true) { [weak self] in
|
||||
if let indexPath = self?.dataSource.indexPath(for: node) {
|
||||
self?.coordinator.selectFeed(indexPath, animated: animated) {
|
||||
completion?()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// If the account for the feed is collapsed, expand it
|
||||
if let account = webFeed.account,
|
||||
let accountNode = coordinator.rootNode.childNodeRepresentingObject(account as AnyObject),
|
||||
!coordinator.isExpanded(accountNode) {
|
||||
|
||||
coordinator.expand(accountNode)
|
||||
applyChanges(animated: false) {
|
||||
discloseFeedInAccount()
|
||||
}
|
||||
|
||||
} else {
|
||||
discloseFeedInAccount()
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue