parent
7a8155f58f
commit
aae5b1dc48
|
@ -44,13 +44,10 @@ private extension WebFeedTreeControllerDelegate {
|
||||||
func childNodesForRootNode(_ rootNode: Node) -> [Node]? {
|
func childNodesForRootNode(_ rootNode: Node) -> [Node]? {
|
||||||
var topLevelNodes = [Node]()
|
var topLevelNodes = [Node]()
|
||||||
|
|
||||||
// Check to see if we should show the SmartFeeds top level by checking the unreadFeed
|
let smartFeedsNode = rootNode.existingOrNewChildNode(with: SmartFeedsController.shared)
|
||||||
if !(isReadFiltered && SmartFeedsController.shared.unreadFeed.unreadCount == 0) {
|
smartFeedsNode.canHaveChildNodes = true
|
||||||
let smartFeedsNode = rootNode.existingOrNewChildNode(with: SmartFeedsController.shared)
|
smartFeedsNode.isGroupItem = true
|
||||||
smartFeedsNode.canHaveChildNodes = true
|
topLevelNodes.append(smartFeedsNode)
|
||||||
smartFeedsNode.isGroupItem = true
|
|
||||||
topLevelNodes.append(smartFeedsNode)
|
|
||||||
}
|
|
||||||
|
|
||||||
topLevelNodes.append(contentsOf: sortedAccountNodes(rootNode))
|
topLevelNodes.append(contentsOf: sortedAccountNodes(rootNode))
|
||||||
|
|
||||||
|
@ -138,21 +135,7 @@ private extension WebFeedTreeControllerDelegate {
|
||||||
}
|
}
|
||||||
|
|
||||||
func sortedAccountNodes(_ parent: Node) -> [Node] {
|
func sortedAccountNodes(_ parent: Node) -> [Node] {
|
||||||
|
|
||||||
var accountFilterException: String? = nil
|
|
||||||
switch filterExceptions.first {
|
|
||||||
case .folder(let accountID, _), .webFeed(let accountID, _):
|
|
||||||
accountFilterException = accountID
|
|
||||||
default:
|
|
||||||
break
|
|
||||||
}
|
|
||||||
|
|
||||||
let nodes = AccountManager.shared.sortedActiveAccounts.compactMap { (account) -> Node? in
|
let nodes = AccountManager.shared.sortedActiveAccounts.compactMap { (account) -> Node? in
|
||||||
|
|
||||||
if isReadFiltered && account.accountID != accountFilterException && account.unreadCount == 0 {
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
let accountNode = parent.existingOrNewChildNode(with: account)
|
let accountNode = parent.existingOrNewChildNode(with: account)
|
||||||
accountNode.canHaveChildNodes = true
|
accountNode.canHaveChildNodes = true
|
||||||
accountNode.isGroupItem = true
|
accountNode.isGroupItem = true
|
||||||
|
|
Loading…
Reference in New Issue