fix: 🐛
This commit is contained in:
@@ -419,6 +419,7 @@ export function extractZapInfoFromReceipt(receiptEvent: Event) {
|
|||||||
|
|
||||||
let senderPubkey: string | undefined
|
let senderPubkey: string | undefined
|
||||||
let recipientPubkey: string | undefined
|
let recipientPubkey: string | undefined
|
||||||
|
let originalEventId: string | undefined
|
||||||
let eventId: string | undefined
|
let eventId: string | undefined
|
||||||
let invoice: string | undefined
|
let invoice: string | undefined
|
||||||
let amount: number | undefined
|
let amount: number | undefined
|
||||||
@@ -436,6 +437,7 @@ export function extractZapInfoFromReceipt(receiptEvent: Event) {
|
|||||||
recipientPubkey = tagValue
|
recipientPubkey = tagValue
|
||||||
break
|
break
|
||||||
case 'e':
|
case 'e':
|
||||||
|
originalEventId = tag[1]
|
||||||
eventId = generateEventIdFromETag(tag)
|
eventId = generateEventIdFromETag(tag)
|
||||||
break
|
break
|
||||||
case 'bolt11':
|
case 'bolt11':
|
||||||
@@ -467,6 +469,7 @@ export function extractZapInfoFromReceipt(receiptEvent: Event) {
|
|||||||
senderPubkey,
|
senderPubkey,
|
||||||
recipientPubkey,
|
recipientPubkey,
|
||||||
eventId,
|
eventId,
|
||||||
|
originalEventId,
|
||||||
invoice,
|
invoice,
|
||||||
amount,
|
amount,
|
||||||
comment,
|
comment,
|
||||||
|
|||||||
@@ -170,11 +170,11 @@ export function NoteStatsProvider({ children }: { children: React.ReactNode }) {
|
|||||||
if (evt.kind === kinds.Zap) {
|
if (evt.kind === kinds.Zap) {
|
||||||
const info = extractZapInfoFromReceipt(evt)
|
const info = extractZapInfoFromReceipt(evt)
|
||||||
if (!info) return
|
if (!info) return
|
||||||
const { eventId, senderPubkey, invoice, amount, comment } = info
|
const { originalEventId, senderPubkey, invoice, amount, comment } = info
|
||||||
if (!eventId || !senderPubkey) return
|
if (!originalEventId || !senderPubkey) return
|
||||||
const newZaps = newZapsMap.get(eventId) || []
|
const newZaps = newZapsMap.get(originalEventId) || []
|
||||||
newZaps.push({ pr: invoice, pubkey: senderPubkey, amount, comment })
|
newZaps.push({ pr: invoice, pubkey: senderPubkey, amount, comment })
|
||||||
newZapsMap.set(eventId, newZaps)
|
newZapsMap.set(originalEventId, newZaps)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user