From e25372313b4c17dfea8f45c96eded8be2592d287 Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Fri, 3 May 2024 18:32:35 -0500 Subject: [PATCH] suggestions: fix profile lookup, limit to 20 items for now --- src/controllers/api/suggestions.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/controllers/api/suggestions.ts b/src/controllers/api/suggestions.ts index b85f05df..bde09165 100644 --- a/src/controllers/api/suggestions.ts +++ b/src/controllers/api/suggestions.ts @@ -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 }));