Fix UI bug with user search and fix race conditions on profiles NIP-05 cache

Signed-off-by: Terry Yiu <git@tyiu.xyz>
Reviewed-by: William Casarin <jb55@jb55.com>
Signed-off-by: William Casarin <jb55@jb55.com>
This commit is contained in:
2023-07-03 21:36:22 -04:00
committed by William Casarin
parent 3d0448a929
commit 640fbf23ea
5 changed files with 30 additions and 16 deletions

View File

@@ -194,7 +194,6 @@ func search_profiles(profiles: Profiles, search: String) -> [SearchedUser] {
let matched_pubkeys = profiles.user_search_cache.search(key: new)
return matched_pubkeys
.map { ($0, profiles.lookup(id: $0)) }
.filter { $1 != nil }
.map { SearchedUser(profile: $1, pubkey: $0) }
.map { SearchedUser(profile: profiles.lookup(id: $0), pubkey: $0) }
.filter { $0.profile != nil }
}