diff --git a/Tusker/Screens/Search/SearchResultsViewController.swift b/Tusker/Screens/Search/SearchResultsViewController.swift index 9d22138afb..3c09653850 100644 --- a/Tusker/Screens/Search/SearchResultsViewController.swift +++ b/Tusker/Screens/Search/SearchResultsViewController.swift @@ -295,7 +295,10 @@ class SearchResultsViewController: UIViewController, CollectionViewController { } if !results.hashtags.isEmpty && resultTypes.contains(.hashtags) { snapshot.appendSections([.hashtags]) - snapshot.appendItems(results.hashtags.map { .hashtag($0) }, toSection: .hashtags) + // mastodon sometimes includes duplicate hashtags with the same name but different urls + // (e.g., containing %C3%B8 vs o) + let uniqueHashtags = results.hashtags.uniques(by: \.name) + snapshot.appendItems(uniqueHashtags.map { .hashtag($0) }, toSection: .hashtags) } if !results.statuses.isEmpty && resultTypes.contains(.statuses) { snapshot.appendSections([.statuses])