Refresh smart feeds when articles refresh.

This commit is contained in:
Brent Simmons 2019-02-03 12:06:11 -08:00
parent ed37282c79
commit cda559728c
1 changed files with 13 additions and 1 deletions

View File

@ -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<Feed>) -> Bool {
// Return true if theres a match or if a folder contains (recursively) one of feeds