From cda559728c3b22605630f8457020c5414efcbb22 Mon Sep 17 00:00:00 2001 From: Brent Simmons Date: Sun, 3 Feb 2019 12:06:11 -0800 Subject: [PATCH] Refresh smart feeds when articles refresh. --- .../Timeline/TimelineViewController.swift | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/NetNewsWire/MainWindow/Timeline/TimelineViewController.swift b/NetNewsWire/MainWindow/Timeline/TimelineViewController.swift index 48a6b24c8..543350c1a 100644 --- a/NetNewsWire/MainWindow/Timeline/TimelineViewController.swift +++ b/NetNewsWire/MainWindow/Timeline/TimelineViewController.swift @@ -419,7 +419,7 @@ class TimelineViewController: NSViewController, UndoableCommandRunner { return } - let shouldFetchAndMergeArticles = representedObjectsContainsAnyFeed(feeds) + let shouldFetchAndMergeArticles = representedObjectsContainsAnyFeed(feeds) || representedObjectsContainsAnyPseudoFeed() if shouldFetchAndMergeArticles { queueFetchAndMergeArticles() } @@ -850,6 +850,18 @@ private extension TimelineViewController { return true } + func representedObjectsContainsAnyPseudoFeed() -> Bool { + guard let representedObjects = representedObjects else { + return false + } + for representedObject in representedObjects { + if representedObject is PseudoFeed { + return true + } + } + return false + } + func representedObjectsContainsAnyFeed(_ feeds: Set) -> Bool { // Return true if there’s a match or if a folder contains (recursively) one of feeds