suggestions: fix profile lookup, limit to 20 items for now

This commit is contained in:
Alex Gleason 2024-05-03 18:32:35 -05:00
parent 4ee4266843
commit e25372313b
No known key found for this signature in database
GPG Key ID: 7211D1F99744FBB7
1 changed files with 3 additions and 2 deletions

View File

@ -33,10 +33,11 @@ async function renderSuggestedAccounts(store: NStore, signal?: AbortSignal) {
{ signal },
);
const pubkeys = [...getTagSet(follows?.tags ?? [], 'p')];
// TODO: pagination
const pubkeys = [...getTagSet(follows?.tags ?? [], 'p')].slice(0, 20);
const profiles = await store.query(
[{ kinds: [1], authors: pubkeys }],
[{ kinds: [0], authors: pubkeys, limit: pubkeys.length }],
{ signal },
)
.then((events) => hydrateEvents({ events, storage: store, signal }));