From 5eed42721e21c7d7c2731687f8311f2b451b6958 Mon Sep 17 00:00:00 2001 From: Maurice Parker Date: Sat, 29 Feb 2020 16:30:13 -0800 Subject: [PATCH] Change so that feeds aren't filtered on select feed in sidebar if they are already visible. --- .../Sidebar/SidebarViewController.swift | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/Mac/MainWindow/Sidebar/SidebarViewController.swift b/Mac/MainWindow/Sidebar/SidebarViewController.swift index 08a897900..8e0ea0a0d 100644 --- a/Mac/MainWindow/Sidebar/SidebarViewController.swift +++ b/Mac/MainWindow/Sidebar/SidebarViewController.swift @@ -183,20 +183,17 @@ protocol SidebarDelegate: class { } @IBAction func gotoToday(_ sender: Any?) { - ensureFeedIsAvailableToSelect(SmartFeedsController.shared.todayFeed) - outlineView.revealAndSelectRepresentedObject(SmartFeedsController.shared.todayFeed, treeController) + selectFeed(SmartFeedsController.shared.todayFeed) focus() } @IBAction func gotoAllUnread(_ sender: Any?) { - ensureFeedIsAvailableToSelect(SmartFeedsController.shared.unreadFeed) - outlineView.revealAndSelectRepresentedObject(SmartFeedsController.shared.unreadFeed, treeController) + selectFeed(SmartFeedsController.shared.unreadFeed) focus() } @IBAction func gotoStarred(_ sender: Any?) { - ensureFeedIsAvailableToSelect(SmartFeedsController.shared.starredFeed) - outlineView.revealAndSelectRepresentedObject(SmartFeedsController.shared.starredFeed, treeController) + selectFeed(SmartFeedsController.shared.starredFeed) focus() } @@ -340,6 +337,7 @@ protocol SidebarDelegate: class { } } + addTreeControllerToFilterExceptions() rebuildTreeAndRestoreSelection() } @@ -411,13 +409,6 @@ private extension SidebarViewController { return node.representedObject as? WebFeed } - func ensureFeedIsAvailableToSelect(_ feed: Feed) { - guard isReadFiltered else { return } - addToFilterExeptionsIfNecessary(feed) - addTreeControllerToFilterExceptions() - rebuildTreeAndRestoreSelection() - } - func addAllSelectedToFilterExceptions() { selectedFeeds.forEach { addToFilterExeptionsIfNecessary($0) } }