mirror of
https://github.com/nbd-wtf/go-nostr.git
synced 2025-05-29 17:19:16 +02:00
sdk: replaceable loader checks if result exists first on map.
This commit is contained in:
parent
f3ef256e65
commit
c3cfb21097
@ -132,7 +132,7 @@ func (sys *System) batchLoadReplaceableEvents(
|
||||
}
|
||||
|
||||
// insert this event at the desired position
|
||||
if results[ie.PubKey].Data == nil || results[ie.PubKey].Data.CreatedAt < ie.CreatedAt {
|
||||
if val, ok := results[ie.PubKey]; !ok || val.Data == nil || val.Data.CreatedAt < ie.CreatedAt {
|
||||
results[ie.PubKey] = dataloader.Result[*nostr.Event]{Data: ie.Event}
|
||||
}
|
||||
case <-aggregatedContext.Done():
|
||||
|
Loading…
x
Reference in New Issue
Block a user