From e675bec1c7cf1b6ec7be0a83350d5a082179d5f7 Mon Sep 17 00:00:00 2001 From: IshaVenikar Date: Tue, 29 Oct 2024 10:33:05 +0530 Subject: [PATCH] Update configure step UI --- .../src/components/projects/create/Configure.tsx | 14 ++++++++------ packages/gql-client/src/client.ts | 4 ++-- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/packages/frontend/src/components/projects/create/Configure.tsx b/packages/frontend/src/components/projects/create/Configure.tsx index 711b448b..e56e7d1d 100644 --- a/packages/frontend/src/components/projects/create/Configure.tsx +++ b/packages/frontend/src/components/projects/create/Configure.tsx @@ -173,17 +173,13 @@ const Configure = () => { const handleFormSubmit = useCallback( async (createFormData: FieldValues) => { - if (!selectedAccount) { - return; - } - - const senderAddress = selectedAccount; const deployerLrn = createFormData.lrn; const deployer = deployers.find( (deployer) => deployer.deployerLrn === deployerLrn, ); let amount: string; + let senderAddress: string; let txHash: string; if (createFormData.option === 'LRN' && !deployer?.minimumPayment) { toast({ @@ -194,7 +190,12 @@ const Configure = () => { }); txHash = ''; + senderAddress = ''; } else { + if (!selectedAccount) return; + + senderAddress = selectedAccount.split(':')[2]; + if (createFormData.option === 'LRN') { amount = deployer?.minimumPayment!; } else { @@ -222,6 +223,7 @@ const Configure = () => { txHash, amount.toString(), ); + if (isTxHashValid === false) { console.error('Invalid Tx hash', txHash); return; @@ -243,7 +245,7 @@ const Configure = () => { const projectId = await createProject( createFormData, environmentVariables, - senderAddress.split(':')[2], + senderAddress, txHash, ); diff --git a/packages/gql-client/src/client.ts b/packages/gql-client/src/client.ts index 201f9fcb..c915dde9 100644 --- a/packages/gql-client/src/client.ts +++ b/packages/gql-client/src/client.ts @@ -442,7 +442,7 @@ export class GQLClient { } async verifyTx(txHash: string, amount: string, senderAddress: string): Promise { - const { data: verifyTx } = await this.client.query({ + const { data } = await this.client.query({ query: queries.verifyTx, variables: { txHash, @@ -451,6 +451,6 @@ export class GQLClient { } }); - return verifyTx; + return data.verifyTx; } }