Fix npub search fails on the first try
Co-authored-by: William Casarin <jb55@jb55.com> Changelog-Fixed: Fix npub search fails on the first try Closes: #1044 Closes: #1100
This commit is contained in:
committed by
William Casarin
parent
a007e18add
commit
f78eeb1f22
@@ -751,8 +751,16 @@ func find_event(state: DamusState, evid: String, search_type: SearchType, find_f
|
||||
break
|
||||
case .event(_, let ev):
|
||||
has_event = true
|
||||
callback(ev)
|
||||
|
||||
state.pool.unsubscribe(sub_id: subid)
|
||||
|
||||
if search_type == .profile && ev.known_kind == .metadata {
|
||||
process_metadata_event(events: state.events, our_pubkey: state.pubkey, profiles: state.profiles, ev: ev) {
|
||||
callback(ev)
|
||||
}
|
||||
} else {
|
||||
callback(ev)
|
||||
}
|
||||
case .eose:
|
||||
if !has_event {
|
||||
attempts += 1
|
||||
|
||||
Reference in New Issue
Block a user