Merge branch 'fix-event-deconstruct' into 'main'

fix: event deconstruct inside getAuthor

See merge request soapbox-pub/ditto!129
This commit is contained in:
Alex Gleason 2024-04-03 21:07:56 +00:00
commit 417ff4ec59
1 changed files with 1 additions and 1 deletions

View File

@ -40,7 +40,7 @@ const getAuthor = async (pubkey: string, opts: GetEventOpts = {}): Promise<Nostr
const { relations = [], signal = AbortSignal.timeout(1000) } = opts; const { relations = [], signal = AbortSignal.timeout(1000) } = opts;
return await optimizer.query([{ authors: [pubkey], kinds: [0], limit: 1 }], { limit: 1, signal }) return await optimizer.query([{ authors: [pubkey], kinds: [0], limit: 1 }], { limit: 1, signal })
.then(([event]) => hydrateEvents({ events: [event], relations, storage: optimizer, signal })) .then((events) => hydrateEvents({ events, relations, storage: optimizer, signal }))
.then(([event]) => event); .then(([event]) => event);
}; };