From 6f50b485b4c525699c6b9228087f1d9184baaada Mon Sep 17 00:00:00 2001 From: ekzyis Date: Wed, 12 Mar 2025 20:09:54 -0500 Subject: [PATCH] Don't poll failed invoices if anon --- wallets/index.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/wallets/index.js b/wallets/index.js index d72227b5..8de108cf 100644 --- a/wallets/index.js +++ b/wallets/index.js @@ -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 }