From 56d2b11bc85f77f6a115567512851d87f517000a Mon Sep 17 00:00:00 2001 From: Shreerang Kale Date: Thu, 1 Aug 2024 11:44:44 +0530 Subject: [PATCH] Remove undefined default value only for input variables --- src/screens/ApproveTransaction.tsx | 8 ++++---- src/screens/ApproveTransfer.tsx | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/screens/ApproveTransaction.tsx b/src/screens/ApproveTransaction.tsx index c5b396f..fd74bb7 100644 --- a/src/screens/ApproveTransaction.tsx +++ b/src/screens/ApproveTransaction.tsx @@ -51,8 +51,8 @@ const ApproveTransaction = ({ route }: ApproveTransactionProps) => { const [cosmosStargateClient, setCosmosStargateClient] = useState(); const [cosmosGasLimit, setCosmosGasLimit] = useState(''); - const [fees, setFees] = useState(''); - const [txError, setTxError] = useState(''); + const [fees, setFees] = useState(); + const [txError, setTxError] = useState(); const [isTxErrorDialogOpen, setIsTxErrorDialogOpen] = useState(false); const [isRequestAccepted, setIsRequestAccepted] = useState(false); @@ -197,7 +197,7 @@ const ApproveTransaction = ({ route }: ApproveTransactionProps) => { // This amount is total fees required for transaction amount: [ { - amount: fees, + amount: fees!, denom: requestedNetwork!.nativeDenom!, }, ], @@ -299,7 +299,7 @@ const ApproveTransaction = ({ route }: ApproveTransactionProps) => { { setIsTxErrorDialogOpen(false); diff --git a/src/screens/ApproveTransfer.tsx b/src/screens/ApproveTransfer.tsx index 9f1b25c..80f88be 100644 --- a/src/screens/ApproveTransfer.tsx +++ b/src/screens/ApproveTransfer.tsx @@ -72,7 +72,7 @@ const ApproveTransfer = ({ route }: SignRequestProps) => { useState(); const [fees, setFees] = useState(''); const [cosmosGasLimit, setCosmosGasLimit] = useState(''); - const [txError, setTxError] = useState(''); + const [txError, setTxError] = useState(); const [isTxErrorDialogOpen, setIsTxErrorDialogOpen] = useState(false); const [ethGasPrice, setEthGasPrice] = useState(); const [ethGasLimit, setEthGasLimit] = useState(); @@ -655,7 +655,7 @@ const ApproveTransfer = ({ route }: SignRequestProps) => { )} { setIsTxErrorDialogOpen(false);