From c62ea68669bfb04fd95005f5b884f853e7521383 Mon Sep 17 00:00:00 2001 From: Shreerang Kale Date: Mon, 28 Oct 2024 11:24:53 +0530 Subject: [PATCH] Set payment done to false if tx request fails --- .../frontend/src/components/projects/create/Configure.tsx | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/packages/frontend/src/components/projects/create/Configure.tsx b/packages/frontend/src/components/projects/create/Configure.tsx index 375392b4..978399be 100644 --- a/packages/frontend/src/components/projects/create/Configure.tsx +++ b/packages/frontend/src/components/projects/create/Configure.tsx @@ -315,18 +315,22 @@ const Configure = () => { onDismiss: dismiss, }); + setIsPaymentDone(true); + return result.signature; } catch (error: any) { console.error('Error sending tokens', error); + toast({ id: 'error-sending-tokens', title: 'Error sending tokens', variant: 'error', onDismiss: dismiss, }); + + setIsPaymentDone(false); } finally { setIsPaymentLoading(false); - setIsPaymentDone(true); } }, [session, signClient, toast], @@ -490,7 +494,7 @@ const Configure = () => { > {!isPaymentDone ? isPaymentLoading - ? 'Paying' + ? 'Transaction Requested' : 'Pay and Deploy' : isLoading ? 'Deploying repo'