Make sure top level nodes are always expanded.
This commit is contained in:
parent
89e9a7b80e
commit
64c1a615b0
|
@ -40,6 +40,7 @@ private extension WebFeedTreeControllerDelegate {
|
|||
let smartFeedsNode = rootNode.existingOrNewChildNode(with: SmartFeedsController.shared)
|
||||
smartFeedsNode.canHaveChildNodes = true
|
||||
smartFeedsNode.isGroupItem = true
|
||||
smartFeedsNode.isExpanded = true
|
||||
topLevelNodes.append(smartFeedsNode)
|
||||
}
|
||||
|
||||
|
@ -136,6 +137,7 @@ private extension WebFeedTreeControllerDelegate {
|
|||
let accountNode = parent.existingOrNewChildNode(with: account)
|
||||
accountNode.canHaveChildNodes = true
|
||||
accountNode.isGroupItem = true
|
||||
accountNode.isExpanded = true
|
||||
return accountNode
|
||||
}
|
||||
return nodes
|
||||
|
|
|
@ -268,7 +268,6 @@ class SceneCoordinator: NSObject, UndoableCommandRunner, UnreadCountProvider {
|
|||
super.init()
|
||||
|
||||
for section in treeController.rootNode.childNodes {
|
||||
section.isExpanded = true
|
||||
shadowTable.append([Node]())
|
||||
}
|
||||
|
||||
|
@ -392,51 +391,23 @@ class SceneCoordinator: NSObject, UndoableCommandRunner, UnreadCountProvider {
|
|||
}
|
||||
|
||||
@objc func accountStateDidChange(_ note: Notification) {
|
||||
|
||||
let rebuildAndExpand = {
|
||||
guard let account = note.userInfo?[Account.UserInfoKey.account] as? Account else {
|
||||
assertionFailure()
|
||||
return
|
||||
}
|
||||
|
||||
self.rebuildBackingStores() {
|
||||
// If we are activating an account, then automatically expand it
|
||||
if account.isActive, let node = self.treeController.rootNode.childNodeRepresentingObject(account) {
|
||||
node.isExpanded = true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if timelineFetcherContainsAnyPseudoFeed() {
|
||||
fetchAndReplaceArticlesAsync {
|
||||
rebuildAndExpand()
|
||||
self.rebuildBackingStores()
|
||||
}
|
||||
} else {
|
||||
rebuildAndExpand()
|
||||
rebuildBackingStores()
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@objc func userDidAddAccount(_ note: Notification) {
|
||||
|
||||
let rebuildAndExpand = {
|
||||
self.rebuildBackingStores() {
|
||||
// Automatically expand any new accounts
|
||||
if let account = note.userInfo?[Account.UserInfoKey.account] as? Account,
|
||||
let node = self.treeController.rootNode.childNodeRepresentingObject(account) {
|
||||
node.isExpanded = true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if timelineFetcherContainsAnyPseudoFeed() {
|
||||
fetchAndReplaceArticlesAsync {
|
||||
rebuildAndExpand()
|
||||
self.rebuildBackingStores()
|
||||
}
|
||||
} else {
|
||||
rebuildAndExpand()
|
||||
rebuildBackingStores()
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@objc func userDidDeleteAccount(_ note: Notification) {
|
||||
|
|
Loading…
Reference in New Issue