diff --git a/Shared/Tree/WebFeedTreeControllerDelegate.swift b/Shared/Tree/WebFeedTreeControllerDelegate.swift index 6fa6fbc8c..fd4d4f754 100644 --- a/Shared/Tree/WebFeedTreeControllerDelegate.swift +++ b/Shared/Tree/WebFeedTreeControllerDelegate.swift @@ -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 diff --git a/iOS/SceneCoordinator.swift b/iOS/SceneCoordinator.swift index 78d02adf3..91c7fcf9f 100644 --- a/iOS/SceneCoordinator.swift +++ b/iOS/SceneCoordinator.swift @@ -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) {