Disclose feed in side bar when selected from context menu even if the feed is filtered. Issue #1805

This commit is contained in:
Maurice Parker 2020-02-29 16:24:14 -08:00
parent 4b2f08e759
commit dac4c2ffb0
2 changed files with 20 additions and 5 deletions

View File

@ -516,7 +516,7 @@ extension MainWindowController: TimelineContainerViewControllerDelegate {
} }
func timelineRequestedWebFeedSelection(_: TimelineContainerViewController, webFeed: WebFeed) { func timelineRequestedWebFeedSelection(_: TimelineContainerViewController, webFeed: WebFeed) {
sidebarViewController?.selectWebFeed(webFeed) sidebarViewController?.selectFeed(webFeed)
} }
} }

View File

@ -329,15 +329,30 @@ protocol SidebarDelegate: class {
// MARK: - API // MARK: - API
func selectWebFeed(_ webFeed: WebFeed) { func selectFeed(_ feed: Feed) {
revealAndSelectRepresentedObject(webFeed as AnyObject) if isReadFiltered, let feedID = feed.feedID {
self.treeControllerDelegate.addFilterException(feedID)
if let webFeed = feed as? WebFeed, let account = webFeed.account {
let parentFolder = account.sortedFolders?.first(where: { $0.objectIsChild(webFeed) })
if let parentFolderFeedID = parentFolder?.feedID {
self.treeControllerDelegate.addFilterException(parentFolderFeedID)
}
}
rebuildTreeAndRestoreSelection()
}
revealAndSelectRepresentedObject(feed as AnyObject)
} }
func deepLinkRevealAndSelect(for userInfo: [AnyHashable : Any]) { func deepLinkRevealAndSelect(for userInfo: [AnyHashable : Any]) {
guard let accountNode = findAccountNode(userInfo), let feedNode = findFeedNode(userInfo, beginningAt: accountNode) else { guard let accountNode = findAccountNode(userInfo),
let feedNode = findFeedNode(userInfo, beginningAt: accountNode),
let feed = feedNode.representedObject as? Feed else {
return return
} }
revealAndSelectRepresentedObject(feedNode.representedObject) selectFeed(feed)
} }
func toggleReadFilter() { func toggleReadFilter() {