Adding the missing search element

This commit is contained in:
Vitor Pamplona
2023-05-16 18:51:08 -04:00
parent 5a3cf40402
commit bb9fa8e144
@@ -214,8 +214,8 @@ open class NewPostViewModel : ViewModel() {
userSuggestionAnchor = it.selection userSuggestionAnchor = it.selection
userSuggestionsMainMessage = true userSuggestionsMainMessage = true
if (lastWord.startsWith("@") && lastWord.length > 2) { if (lastWord.startsWith("@") && lastWord.length > 2) {
NostrSearchEventOrUserDataSource.search(lastWord.removePrefix("@"))
userSuggestions = LocalCache.findUsersStartingWith(lastWord.removePrefix("@")).sortedWith(compareBy({ account?.isFollowing(it) }, { it.toBestDisplayName() })).reversed() userSuggestions = LocalCache.findUsersStartingWith(lastWord.removePrefix("@")).sortedWith(compareBy({ account?.isFollowing(it) }, { it.toBestDisplayName() })).reversed()
println("AAAA" + lastWord.removePrefix("@") + userSuggestions.size)
} else { } else {
NostrSearchEventOrUserDataSource.clear() NostrSearchEventOrUserDataSource.clear()
userSuggestions = emptyList() userSuggestions = emptyList()