refactor: return set in a different way

This commit is contained in:
P. Reis 2024-09-17 14:37:04 -03:00
parent 7eab62b9a9
commit 19069c0417

View file

@ -65,7 +65,7 @@ async function getFollowedPubkeys(pubkey: string, signal?: AbortSignal): Promise
/** Get pubkeys the user follows, including the user's own pubkey. */
async function getFeedPubkeys(pubkey: string): Promise<Set<string>> {
const authors = await getFollowedPubkeys(pubkey);
return new Set([...authors, pubkey]);
return authors.add(pubkey);
}
async function getAncestors(store: NStore, event: NostrEvent, result: NostrEvent[] = []): Promise<NostrEvent[]> {