Create and use fetchUnsortedArticles(for:), which is common code that needed to be a separate function.
This commit is contained in:
parent
21f1863cd0
commit
9fea9c2d12
@ -641,6 +641,15 @@ private extension TimelineViewController {
|
||||
return
|
||||
}
|
||||
|
||||
let fetchedArticles = fetchUnsortedArticles(for: representedObjects)
|
||||
let sortedArticles = Array(fetchedArticles).sortedByDate()
|
||||
if articles != sortedArticles {
|
||||
articles = sortedArticles
|
||||
}
|
||||
}
|
||||
|
||||
func fetchUnsortedArticles(for representedObjects: [Any]) -> Set<Article> {
|
||||
|
||||
var fetchedArticles = Set<Article>()
|
||||
|
||||
for object in representedObjects {
|
||||
@ -653,13 +662,9 @@ private extension TimelineViewController {
|
||||
}
|
||||
}
|
||||
|
||||
let sortedArticles = Array(fetchedArticles).sortedByDate()
|
||||
if articles != sortedArticles {
|
||||
articles = sortedArticles
|
||||
}
|
||||
return fetchedArticles
|
||||
}
|
||||
|
||||
|
||||
func fetchAndMergeArticles() {
|
||||
|
||||
let selectedArticleIDs = selectedArticles.articleIDs()
|
||||
|
Loading…
x
Reference in New Issue
Block a user