@@ -10,8 +10,7 @@ import { useWalletPayment } from '@/wallets/client/hooks'
1010this is just like useMutation with a few changes:
11111. pays an invoice returned by the mutation
12122. 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
15143. onCompleted behaves a little differently, but analogously to useMutation, ie clientside side effects
1615 of completion can still rely on it
1716 a. it's called before the invoice is paid for optimistic updates
@@ -77,7 +76,7 @@ export function usePaidMutation (mutation,
7776
7877 // use the most inner callbacks/options if they exist
7978 const {
80- onPaid, onPayError, forceWaitForPayment , persistOnNavigate,
79+ onPaid, onPayError, persistOnNavigate,
8180 update, waitFor = inv => inv ?. actionState === 'PAID' , updateOnFallback
8281 } = { ...options , ...innerOptions }
8382 const ourOnCompleted = innerOnCompleted || onCompleted
@@ -107,7 +106,7 @@ export function usePaidMutation (mutation,
107106 } )
108107
109108 // should we wait for the invoice to be paid?
110- if ( response ?. paymentMethod === 'OPTIMISTIC' && ! forceWaitForPayment ) {
109+ if ( response ?. paymentMethod === 'OPTIMISTIC' ) {
111110 // onCompleted is called before the invoice is paid for optimistic updates
112111 ourOnCompleted ?. ( data )
113112 // don't wait to pay the invoice
0 commit comments