Removed duplicate sort parameter change handling functions

This commit is contained in:
Phil Viso 2019-09-13 08:29:56 -05:00
parent 8a6e3c9f37
commit cc6767e0f6
2 changed files with 7 additions and 18 deletions

View File

@ -126,14 +126,14 @@ final class TimelineViewController: NSViewController, UndoableCommandRunner, Unr
private var sortDirection = AppDefaults.timelineSortDirection {
didSet {
if sortDirection != oldValue {
sortDirectionDidChange()
sortParametersDidChange()
}
}
}
private var groupByFeed = AppDefaults.timelineGroupByFeed {
didSet {
if groupByFeed != oldValue {
groupByFeedDidChange()
sortParametersDidChange()
}
}
}
@ -884,14 +884,7 @@ private extension TimelineViewController {
}
}
func sortDirectionDidChange() {
performBlockAndRestoreSelection {
let unsortedArticles = Set(articles)
replaceArticles(with: unsortedArticles)
}
}
func groupByFeedDidChange() {
func sortParametersDidChange() {
performBlockAndRestoreSelection {
let unsortedArticles = Set(articles)
replaceArticles(with: unsortedArticles)

View File

@ -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,11 +1234,7 @@ private extension SceneCoordinator {
}
}
func sortDirectionDidChange() {
replaceArticles(with: Set(articles), animate: true)
}
func groupByFeedDidChange() {
func sortParametersDidChange() {
replaceArticles(with: Set(articles), animate: true)
}