@@ -10,8 +10,7 @@ import { useWalletPayment } from '@/wallets/client/hooks'
10
10
this is just like useMutation with a few changes:
11
11
1. pays an invoice returned by the mutation
12
12
2. takes an onPaid and onPayError callback, and additional options for payment behavior
13
- - namely forceWaitForPayment which will always wait for the invoice to be paid
14
- - and persistOnNavigate which will keep the invoice in the cache after navigation
13
+ - persistOnNavigate which will keep the invoice in the cache after navigation
15
14
3. onCompleted behaves a little differently, but analogously to useMutation, ie clientside side effects
16
15
of completion can still rely on it
17
16
a. it's called before the invoice is paid for optimistic updates
@@ -77,7 +76,7 @@ export function usePaidMutation (mutation,
77
76
78
77
// use the most inner callbacks/options if they exist
79
78
const {
80
- onPaid, onPayError, forceWaitForPayment , persistOnNavigate,
79
+ onPaid, onPayError, persistOnNavigate,
81
80
update, waitFor = inv => inv ?. actionState === 'PAID' , updateOnFallback
82
81
} = { ...options , ...innerOptions }
83
82
const ourOnCompleted = innerOnCompleted || onCompleted
@@ -107,7 +106,7 @@ export function usePaidMutation (mutation,
107
106
} )
108
107
109
108
// should we wait for the invoice to be paid?
110
- if ( response ?. paymentMethod === 'OPTIMISTIC' && ! forceWaitForPayment ) {
109
+ if ( response ?. paymentMethod === 'OPTIMISTIC' ) {
111
110
// onCompleted is called before the invoice is paid for optimistic updates
112
111
ourOnCompleted ?. ( data )
113
112
// don't wait to pay the invoice
0 commit comments