Fix relay profile loading, add getTopicTags, allow mapping events to multiple items

This commit is contained in:
Jon Staab
2024-09-11 09:15:03 -07:00
parent bece689530
commit 4e113faa1a
7 changed files with 62 additions and 40 deletions
+4 -6
View File
@@ -54,20 +54,18 @@ export const {
load: batcher(800, async (lnurls: string[]) => {
const fresh = await fetchZappers(uniq(lnurls))
const stale = zappersByLnurl.get()
const items: Zapper[] = lnurls.map(lnurl => {
for (const lnurl of lnurls) {
const newZapper = fresh.get(lnurl)
const oldZapper = stale.get(lnurl)
if (newZapper) {
stale.set(lnurl, {...newZapper, lnurl})
}
return {...oldZapper, ...newZapper, lnurl}
})
}
zappers.set(Array.from(stale.values()))
return items
return lnurls
}),
})