Merge pull request #1971 from stackernews/fix-anon-failed-invoices
Don't poll failed invoices if anon
This commit is contained in:
commit
0d93c92e30
@ -236,6 +236,7 @@ function RetryHandler ({ children }) {
|
||||
const waitForWalletPayment = useWalletPayment()
|
||||
const invoiceHelper = useInvoice()
|
||||
const [getFailedInvoices] = useLazyQuery(FAILED_INVOICES, { fetchPolicy: 'network-only', nextFetchPolicy: 'network-only' })
|
||||
const { me } = useMe()
|
||||
|
||||
const retry = useCallback(async (invoice) => {
|
||||
const newInvoice = await invoiceHelper.retry({ ...invoice, newAttempt: true })
|
||||
@ -255,6 +256,8 @@ function RetryHandler ({ children }) {
|
||||
// we always retry failed invoices, even if the user has no wallets on any client
|
||||
// to make sure that failed payments will always show up in notifications eventually
|
||||
|
||||
if (!me) return
|
||||
|
||||
const retryPoll = async () => {
|
||||
let failedInvoices
|
||||
try {
|
||||
@ -298,7 +301,7 @@ function RetryHandler ({ children }) {
|
||||
|
||||
queuePoll()
|
||||
return stopPolling
|
||||
}, [wallets, getFailedInvoices, retry])
|
||||
}, [me?.id, wallets, getFailedInvoices, retry])
|
||||
|
||||
return children
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user