Add always on unread "filter" to Unread.

This commit is contained in:
Maurice Parker 2019-11-21 20:31:58 -06:00
parent 2d210a3f17
commit 654f40a98e
2 changed files with 16 additions and 14 deletions

View File

@ -96,8 +96,9 @@ class MasterTimelineViewController: UITableViewController, UndoableCommandRunner
case .read:
filterButton.image = AppAssets.filterInactiveImage
coordinator.showAllArticles()
default:
break
case .unavailable:
filterButton.image = AppAssets.filterActiveImage
coordinator.refreshTimeline()
}
}
@ -494,13 +495,9 @@ private extension MasterTimelineViewController {
switch coordinator.articleReadFilter {
case .none:
filterButton.isHidden = false
filterButton.image = AppAssets.filterInactiveImage
case .read:
filterButton.isHidden = false
filterButton.image = AppAssets.filterActiveImage
default:
filterButton.isHidden = true
filterButton.image = AppAssets.filterActiveImage
}
tableView.selectRow(at: nil, animated: false, scrollPosition: .top)

View File

@ -379,7 +379,7 @@ class SceneCoordinator: NSObject, UndoableCommandRunner, UnreadCountProvider {
@objc func containerChildrenDidChange(_ note: Notification) {
if timelineFetcherContainsAnyPseudoFeed() || timelineFetcherContainsAnyFolder() {
fetchAndReplaceArticlesAsync() {}
refreshTimeline()
}
rebuildBackingStores()
}
@ -395,6 +395,7 @@ class SceneCoordinator: NSObject, UndoableCommandRunner, UnreadCountProvider {
@objc func accountStateDidChange(_ note: Notification) {
if timelineFetcherContainsAnyPseudoFeed() {
fetchAndReplaceArticlesAsync {
self.masterTimelineViewController?.reinitializeArticles()
self.rebuildBackingStores()
}
} else {
@ -405,6 +406,7 @@ class SceneCoordinator: NSObject, UndoableCommandRunner, UnreadCountProvider {
@objc func userDidAddAccount(_ note: Notification) {
if timelineFetcherContainsAnyPseudoFeed() {
fetchAndReplaceArticlesAsync {
self.masterTimelineViewController?.reinitializeArticles()
self.rebuildBackingStores()
}
} else {
@ -415,6 +417,7 @@ class SceneCoordinator: NSObject, UndoableCommandRunner, UnreadCountProvider {
@objc func userDidDeleteAccount(_ note: Notification) {
if timelineFetcherContainsAnyPseudoFeed() {
fetchAndReplaceArticlesAsync {
self.masterTimelineViewController?.reinitializeArticles()
self.rebuildBackingStores()
}
} else {
@ -462,6 +465,12 @@ class SceneCoordinator: NSObject, UndoableCommandRunner, UnreadCountProvider {
return 0
}
func refreshTimeline() {
fetchAndReplaceArticlesAsync() {
self.masterTimelineViewController?.reinitializeArticles()
}
}
func showAllFeeds() {
treeControllerDelegate.isUnreadFiltered = false
rebuildBackingStores()
@ -474,16 +483,12 @@ class SceneCoordinator: NSObject, UndoableCommandRunner, UnreadCountProvider {
func showAllArticles() {
articleReadFilter = .none
fetchAndReplaceArticlesAsync {
self.rebuildBackingStores()
}
refreshTimeline()
}
func hideUnreadArticles() {
articleReadFilter = .read
fetchAndReplaceArticlesAsync {
self.rebuildBackingStores()
}
refreshTimeline()
}
func expand(_ node: Node) {