mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-01-17 11:08:06 +00:00
Fix sorted list in MagicSearch when friend is nil
This commit is contained in:
parent
7e2c429052
commit
a211d0c994
1 changed files with 7 additions and 5 deletions
|
|
@ -94,11 +94,13 @@ final class MagicSearchSingleton: ObservableObject {
|
|||
}
|
||||
}
|
||||
|
||||
let sortedLastSearch = lastSearchFriend.sorted(by: {
|
||||
$0.friend!.name!.lowercased().folding(options: .diacriticInsensitive, locale: .current)
|
||||
<
|
||||
$1.friend!.name!.lowercased().folding(options: .diacriticInsensitive, locale: .current)
|
||||
})
|
||||
let sortedLastSearch = lastSearchFriend.sorted {
|
||||
let name1 = $0.friend?.name?.lowercased()
|
||||
.folding(options: .diacriticInsensitive, locale: .current) ?? ""
|
||||
let name2 = $1.friend?.name?.lowercased()
|
||||
.folding(options: .diacriticInsensitive, locale: .current) ?? ""
|
||||
return name1 < name2
|
||||
}
|
||||
|
||||
var addedAvatarListModel: [ContactAvatarModel] = []
|
||||
sortedLastSearch.forEach { searchResult in
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue