Skip to content

Commit 292a20b

Browse files
authored
Remove unused forceWaitForPayment (#2529)
1 parent e967455 commit 292a20b

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

components/use-paid-mutation.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,7 @@ import { useWalletPayment } from '@/wallets/client/hooks'
1010
this is just like useMutation with a few changes:
1111
1. pays an invoice returned by the mutation
1212
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
1514
3. 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

Comments
 (0)