Remove filtering of Accounts and Smartfeeds. Issue #1377 & #1376

This commit is contained in:
Maurice Parker 2019-12-01 17:54:34 -06:00
parent 7a8155f58f
commit aae5b1dc48
1 changed files with 4 additions and 21 deletions

View File

@ -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
if !(isReadFiltered && SmartFeedsController.shared.unreadFeed.unreadCount == 0) {
let smartFeedsNode = rootNode.existingOrNewChildNode(with: SmartFeedsController.shared) let smartFeedsNode = rootNode.existingOrNewChildNode(with: SmartFeedsController.shared)
smartFeedsNode.canHaveChildNodes = true smartFeedsNode.canHaveChildNodes = true
smartFeedsNode.isGroupItem = true smartFeedsNode.isGroupItem = true
topLevelNodes.append(smartFeedsNode) 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