diff --git a/lib/paymentPollingMain.ts b/lib/paymentPollingMain.ts index fba69ce..73a90ba 100644 --- a/lib/paymentPollingMain.ts +++ b/lib/paymentPollingMain.ts @@ -57,7 +57,7 @@ export async function sendPrivateContentAfterPayment( const paymentHash = await resolvePaymentHashForPurchaseNote({ articlePaymentHash: article.paymentHash, articleId, - zapReceiptId, + ...(zapReceiptId ? { zapReceiptId } : {}), }) const category = normalizePurchaseNoteCategory(article.category) @@ -83,9 +83,7 @@ export async function sendPrivateContentAfterPayment( return logPaymentResult(result, articleId, recipientPubkey, amount) } -function normalizePurchaseNoteCategory( - category: 'author-presentation' | 'science-fiction' | 'scientific-research' | string -): 'science-fiction' | 'scientific-research' | undefined { +function normalizePurchaseNoteCategory(category: string | undefined): 'science-fiction' | 'scientific-research' | undefined { if (category === 'science-fiction' || category === 'scientific-research') { return category }