subtle change to usePaidMutation callback order
This commit is contained in:
parent
0aa5ba4955
commit
63e60fe2bc
|
@ -88,11 +88,11 @@ export function usePaidMutation (mutation,
|
|||
hash: invoice.hash
|
||||
}
|
||||
}))
|
||||
ourOnCompleted?.(data)
|
||||
onPaid?.(client.cache, { data })
|
||||
// block until the invoice to be marked as paid
|
||||
// for pessimisitic actions, they won't show up on navigation until they are marked as paid
|
||||
await invoiceWaiter.waitUntilPaid(invoice, inv => inv?.actionState === 'PAID')
|
||||
ourOnCompleted?.(data)
|
||||
onPaid?.(client.cache, { data })
|
||||
} catch (e) {
|
||||
console.error('usePaidMutation: failed to pay invoice', e)
|
||||
onPayError?.(e, client.cache, { data })
|
||||
|
|
Loading…
Reference in New Issue