diff --git a/Mastodon/Scene/Compose/AutoComplete/AutoCompleteViewModel.swift b/Mastodon/Scene/Compose/AutoComplete/AutoCompleteViewModel.swift index dc6ab1789..3110f93e3 100644 --- a/Mastodon/Scene/Compose/AutoComplete/AutoCompleteViewModel.swift +++ b/Mastodon/Scene/Compose/AutoComplete/AutoCompleteViewModel.swift @@ -46,7 +46,7 @@ final class AutoCompleteViewModel { var snapshot = NSDiffableDataSourceSnapshot() snapshot.appendSections([.main]) - snapshot.appendItems(items, toSection: .main) + snapshot.appendItems(items.removingDuplicates(), toSection: .main) if let currentState = self.stateMachine.currentState { switch currentState { case is State.Loading, is State.Fail: diff --git a/Mastodon/Scene/Discovery/Hashtags/DiscoveryHashtagsViewModel+Diffable.swift b/Mastodon/Scene/Discovery/Hashtags/DiscoveryHashtagsViewModel+Diffable.swift index 0370f3f58..19241d2e6 100644 --- a/Mastodon/Scene/Discovery/Hashtags/DiscoveryHashtagsViewModel+Diffable.swift +++ b/Mastodon/Scene/Discovery/Hashtags/DiscoveryHashtagsViewModel+Diffable.swift @@ -32,7 +32,7 @@ extension DiscoveryHashtagsViewModel { snapshot.appendSections([.hashtags]) let items = hashtags.map { DiscoveryItem.hashtag($0) } - snapshot.appendItems(items, toSection: .hashtags) + snapshot.appendItems(items.removingDuplicates(), toSection: .hashtags) diffableDataSource.apply(snapshot) }