From acabf995c652b775b2748356ac8dd1dc0b282df9 Mon Sep 17 00:00:00 2001 From: austinkelsay Date: Fri, 28 Feb 2025 11:37:43 -0600 Subject: [PATCH 1/2] Fix param replaceable even format in filters --- src/hooks/nostrQueries/zaps/useZapsQuery.js | 2 +- src/hooks/nostrQueries/zaps/useZapsSubscription.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/hooks/nostrQueries/zaps/useZapsQuery.js b/src/hooks/nostrQueries/zaps/useZapsQuery.js index f20c153..d6b011b 100644 --- a/src/hooks/nostrQueries/zaps/useZapsQuery.js +++ b/src/hooks/nostrQueries/zaps/useZapsQuery.js @@ -16,7 +16,7 @@ export function useZapsQuery({ event, type }) { const filters = [ { kinds: [9735], "#e": [event.id] }, - { kinds: [9735], "#a": [`${event.kind}:${event.id}:${event.d}`] } + { kinds: [9735], "#a": [`${event.kind}:${event.pubkey}:${event.d}`] } ]; const events = await ndk.fetchEvents(filters, { closeOnEose: true }); diff --git a/src/hooks/nostrQueries/zaps/useZapsSubscription.js b/src/hooks/nostrQueries/zaps/useZapsSubscription.js index 6e7ffc6..e90a9b0 100644 --- a/src/hooks/nostrQueries/zaps/useZapsSubscription.js +++ b/src/hooks/nostrQueries/zaps/useZapsSubscription.js @@ -26,7 +26,7 @@ export function useZapsSubscription({ event }) { try { const filters = [ { kinds: [9735], "#e": [event.id] }, - { kinds: [9735], "#a": [`${event.kind}:${event.pubkey}:${event.id}`] } + { kinds: [9735], "#a": [`${event.kind}:${event.pubkey}:${event.d}`] } ]; subscription = ndk.subscribe(filters, { From 0add7c54bd6bb30f59cab08b68611c8298ca9cfd Mon Sep 17 00:00:00 2001 From: austinkelsay Date: Fri, 28 Feb 2025 12:21:35 -0600 Subject: [PATCH 2/2] Fix get total from zaps helper function --- src/utils/lightning.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/utils/lightning.js b/src/utils/lightning.js index 6202069..5b1b8dc 100644 --- a/src/utils/lightning.js +++ b/src/utils/lightning.js @@ -10,7 +10,7 @@ export const getTotalFromZaps = (zaps, event) => { let uniqueZaps = new Set(); zaps.forEach((zap) => { // If the zap matches the event or the parameterized event, then add the zap to the total - if ((zap.tags.find(tag => tag[0] === "e" && tag[1] === event.id) || zap.tags.find(tag => tag[0] === "a" && tag[1] === `${event.kind}:${event.id}:${event.d}`)) &&!uniqueZaps.has(zap.id)) { + if ((zap.tags.find(tag => tag[0] === "e" && tag[1] === event.id) || zap.tags.find(tag => tag[0] === "a" && tag[1] === `${event.kind}:${event.pubkey}:${event.d}`)) &&!uniqueZaps.has(zap.id)) { uniqueZaps.add(zap.id); const bolt11Tag = zap.tags.find(tag => tag[0] === "bolt11"); const invoice = bolt11Tag ? bolt11Tag[1] : null;