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
@@ -80,20 +80,18 @@ export const {
load: batcher(800, async (nip05s: string[]) => {
const fresh = await fetchHandles(uniq(nip05s))
const stale = handlesByNip05.get()
const items: Handle[] = nip05s.map(nip05 => {
for (const nip05 of nip05s) {
const newHandle = fresh.get(nip05)
const oldHandle = stale.get(nip05)
if (newHandle) {
stale.set(nip05, {...newHandle, nip05})
}
return {...oldHandle, ...newHandle, nip05}
})
}
handles.set(Array.from(stale.values()))
return items
return nip05s
}),
})