Skip to content

Commit

Permalink
wait for invoice cancellation
Browse files Browse the repository at this point in the history
  • Loading branch information
riccardobl committed Nov 5, 2024
1 parent 9b9627d commit 7838c33
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion components/use-paid-mutation.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,11 @@ export function usePaidMutation (mutation,

if (response.retriable) {
// every wallet failed, but we can still retry, so let's just cancel the invoice and ask for a better one
invoiceHelper.cancel(invoice).catch(console.error)
try {
await invoiceHelper.cancel(invoice)
} catch (err) {
console.error('usePaidMutation: failed to cancel invoice', err)
}
const retry = retryPaidAction({ variables: { invoiceId: parseInt(invoice.id) } })
response = retry.data?.retryPaidAction
invoice = response?.invoice
Expand Down

0 comments on commit 7838c33

Please sign in to comment.