feat: nak req
This commit is contained in:
parent
ac196cd662
commit
a6d6a19199
9 changed files with 388 additions and 25 deletions
|
|
@ -284,15 +284,22 @@ const NoteList = forwardRef<
|
|||
return () => {}
|
||||
}
|
||||
|
||||
const { closer, timelineKey } = await client.subscribeTimeline(
|
||||
subRequests.map(({ urls, filter }) => ({
|
||||
urls,
|
||||
filter: {
|
||||
kinds: showKinds ?? [],
|
||||
...filter,
|
||||
limit: areAlgoRelays ? ALGO_LIMIT : LIMIT
|
||||
const preprocessedSubRequests = await Promise.all(
|
||||
subRequests.map(async ({ urls, filter }) => {
|
||||
const relays = urls.length ? urls : await client.determineRelaysByFilter(filter)
|
||||
return {
|
||||
urls: relays,
|
||||
filter: {
|
||||
kinds: showKinds ?? [],
|
||||
...filter,
|
||||
limit: areAlgoRelays ? ALGO_LIMIT : LIMIT
|
||||
}
|
||||
}
|
||||
})),
|
||||
})
|
||||
)
|
||||
|
||||
const { closer, timelineKey } = await client.subscribeTimeline(
|
||||
preprocessedSubRequests,
|
||||
{
|
||||
onEvents: (events, eosed) => {
|
||||
if (events.length > 0) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue