mirror of
https://github.com/Ranchero-Software/NetNewsWire
synced 2025-08-12 06:26:36 +00:00
Removed duplicate sort parameter change handling functions
This commit is contained in:
@@ -66,14 +66,14 @@ class SceneCoordinator: NSObject, UndoableCommandRunner, UnreadCountProvider {
|
||||
private(set) var sortDirection = AppDefaults.timelineSortDirection {
|
||||
didSet {
|
||||
if sortDirection != oldValue {
|
||||
sortDirectionDidChange()
|
||||
sortParametersDidChange()
|
||||
}
|
||||
}
|
||||
}
|
||||
private(set) var groupByFeed = AppDefaults.timelineGroupByFeed {
|
||||
didSet {
|
||||
if groupByFeed != oldValue {
|
||||
groupByFeedDidChange()
|
||||
sortParametersDidChange()
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1234,14 +1234,10 @@ private extension SceneCoordinator {
|
||||
}
|
||||
}
|
||||
|
||||
func sortDirectionDidChange() {
|
||||
func sortParametersDidChange() {
|
||||
replaceArticles(with: Set(articles), animate: true)
|
||||
}
|
||||
|
||||
func groupByFeedDidChange() {
|
||||
replaceArticles(with: Set(articles), animate: true)
|
||||
}
|
||||
|
||||
|
||||
func replaceArticles(with unsortedArticles: Set<Article>, animate: Bool) {
|
||||
let sortedArticles = Array(unsortedArticles).sortedByDate(sortDirection, groupByFeed: groupByFeed)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user