Skip to content

Commit

Permalink
Merge pull request #3532 from Wevah/article-copy-order-fix
Browse files Browse the repository at this point in the history
Return [Article] from articlesForIndexes() instead of Set<Article>
  • Loading branch information
vincode-io authored Jun 8, 2022
2 parents d9d00b4 + ae09d52 commit 6386a51
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Mac/MainWindow/Timeline/TimelineViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ final class TimelineViewController: NSViewController, UndoableCommandRunner, Unr

var showsSearchResults = false
var selectedArticles: [Article] {
return Array(articles.articlesForIndexes(tableView.selectedRowIndexes))
return articles.articlesForIndexes(tableView.selectedRowIndexes)
}

var hasAtLeastOneSelectedArticle: Bool {
Expand Down
6 changes: 3 additions & 3 deletions Shared/Timeline/ArticleArray.swift
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,10 @@ extension Array where Element == Article {
return nil
}

func articlesForIndexes(_ indexes: IndexSet) -> Set<Article> {
return Set(indexes.compactMap{ (oneIndex) -> Article? in
func articlesForIndexes(_ indexes: IndexSet) -> [Article] {
return indexes.compactMap{ (oneIndex) -> Article? in
return articleAtRow(oneIndex)
})
}
}

func sortedByDate(_ sortDirection: ComparisonResult, groupByFeed: Bool = false) -> ArticleArray {
Expand Down

0 comments on commit 6386a51

Please sign in to comment.