From 1a14f8d5b1b6a0b0c6f8db2ec8d657bf12fd28c2 Mon Sep 17 00:00:00 2001 From: Riccardo Balbo Date: Tue, 5 Nov 2024 18:36:06 +0100 Subject: [PATCH] fix: await retry mutation --- components/use-paid-mutation.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/components/use-paid-mutation.js b/components/use-paid-mutation.js index 6b34fe0bc..558109e0f 100644 --- a/components/use-paid-mutation.js +++ b/components/use-paid-mutation.js @@ -59,7 +59,7 @@ export function usePaidMutation (mutation, } catch (err) { console.error('usePaidMutation: failed to cancel invoice', err) } - const retry = retryPaidAction({ variables: { invoiceId: parseInt(invoice.id) } }) + const retry = await retryPaidAction({ variables: { invoiceId: parseInt(invoice.id) } }) response = retry.data?.retryPaidAction invoice = response?.invoice } else break @@ -67,7 +67,7 @@ export function usePaidMutation (mutation, // we try one last time using fee credits try { - const retry = retryPaidAction({ variables: { invoiceId: parseInt(invoice.id), forceFeeCredit: true } }) + const retry = await retryPaidAction({ variables: { invoiceId: parseInt(invoice.id), forceFeeCredit: true } }) response = retry.data?.retryPaidAction // we paid with fee credits, so we don't need the invoice anymore invoiceHelper.cancel(invoice).catch(console.error)