fix: duplicate auto complete items may crash the app issue
This commit is contained in:
parent
975f8205d2
commit
2784fb8771
|
@ -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:
|
||||
|
|
Loading…
Reference in New Issue