1
0
mirror of https://github.com/mastodon/mastodon-ios.git synced 2025-01-23 14:10:26 +01:00

fix: duplicate auto complete items may crash the app issue

This commit is contained in:
CMK 2022-05-13 13:59:54 +08:00
parent 975f8205d2
commit 2784fb8771

View File

@ -46,7 +46,7 @@ final class AutoCompleteViewModel {
var snapshot = NSDiffableDataSourceSnapshot<AutoCompleteSection, AutoCompleteItem>()
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: