From a55c5122f747c068942ab93986d6cd2fb5ccaa67 Mon Sep 17 00:00:00 2001 From: Bojan Mojsilovic Date: Fri, 26 Apr 2024 17:20:02 +0200 Subject: [PATCH] Allow guests to see top zaps --- src/lib/notes.tsx | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/src/lib/notes.tsx b/src/lib/notes.tsx index e38ae6e..c4ce5bf 100644 --- a/src/lib/notes.tsx +++ b/src/lib/notes.tsx @@ -562,14 +562,23 @@ export const getEventQuotes = (eventId: string, subid: string, offset = 0) => { }; export const getEventZaps = (eventId: string, user_pubkey: string | undefined, subid: string, limit: number, offset = 0) => { - if (!user_pubkey) return; - const event_id = eventId.startsWith('note1') ? npubToHex(eventId) : eventId; + let payload = { + event_id, + limit, + offset + }; + + if (user_pubkey) { + // @ts-ignore + payload.user_pubkey = user_pubkey; + } + sendMessage(JSON.stringify([ "REQ", subid, - {cache: ["event_zaps_by_satszapped", { event_id, user_pubkey, limit, offset }]}, + {cache: ["event_zaps_by_satszapped", { ...payload }]}, ])); };