Remove unused useReactionCount, seed reactions from batch engagement

- Delete useReactionCount hook (replaced by useReactions)
- Remove fetchReactionCount (no longer referenced)
- Seed per-note reaction cache from fetchBatchEngagement in trending
  feed, so emoji pills render instantly without individual fetches
This commit is contained in:
Jure
2026-03-27 18:21:36 +01:00
parent b46d383200
commit 616c3cad27
4 changed files with 9 additions and 36 deletions

View File

@@ -15,12 +15,6 @@ export async function publishReaction(eventId: string, eventPubkey: string, reac
await event.publish();
}
export async function fetchReactionCount(eventId: string): Promise<number> {
const instance = getNDK();
const filter: NDKFilter = { kinds: [NDKKind.Reaction], "#e": [eventId] };
const events = await fetchWithTimeout(instance, filter, SINGLE_TIMEOUT);
return events.size;
}
export interface GroupedReactions {
groups: Map<string, number>;

View File

@@ -2,7 +2,7 @@ export { getNDK, getNDKUptimeMs, connectToRelays, ensureConnected, resetNDK, get
export { fetchGlobalFeed, fetchFollowFeed, fetchUserNotes, fetchUserNotesNIP65, fetchNoteById, fetchReplies, publishNote, publishReply, publishRepost, publishQuote, fetchHashtagFeed, fetchThreadEvents, fetchAncestors } from "./notes";
export { publishProfile, publishContactList, fetchProfile, fetchFollowSuggestions, fetchMentions, fetchFollowers, fetchNewFollowers } from "./social";
export { publishArticle, fetchArticle, fetchAuthorArticles, fetchArticleFeed, searchArticles, fetchByAddr } from "./articles";
export { publishReaction, fetchReactionCount, fetchReplyCount, fetchZapCount, fetchReactions, groupReactions, fetchBatchEngagement, fetchZapsReceived, fetchZapsSent } from "./engagement";
export { publishReaction, fetchReplyCount, fetchZapCount, fetchReactions, groupReactions, fetchBatchEngagement, fetchZapsReceived, fetchZapsSent } from "./engagement";
export type { GroupedReactions, BatchEngagement } from "./engagement";
export { fetchDMConversations, fetchDMThread, sendDM, decryptDM } from "./dms";
export { fetchBookmarkList, publishBookmarkList, fetchBookmarkListFull, publishBookmarkListFull } from "./bookmarks";