Remove undefined default value only for input variables

This commit is contained in:
Shreerang Kale 2024-08-01 11:44:44 +05:30
parent 98755b9089
commit 56d2b11bc8
2 changed files with 6 additions and 6 deletions

View File

@ -51,8 +51,8 @@ const ApproveTransaction = ({ route }: ApproveTransactionProps) => {
const [cosmosStargateClient, setCosmosStargateClient] =
useState<LaconicClient>();
const [cosmosGasLimit, setCosmosGasLimit] = useState<string>('');
const [fees, setFees] = useState<string>('');
const [txError, setTxError] = useState<string>('');
const [fees, setFees] = useState<string>();
const [txError, setTxError] = useState<string>();
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) => {
</>
</ScrollView>
<TxErrorDialog
error={txError}
error={txError!}
visible={isTxErrorDialogOpen}
hideDialog={async () => {
setIsTxErrorDialogOpen(false);

View File

@ -72,7 +72,7 @@ const ApproveTransfer = ({ route }: SignRequestProps) => {
useState<SigningStargateClient>();
const [fees, setFees] = useState<string>('');
const [cosmosGasLimit, setCosmosGasLimit] = useState<string>('');
const [txError, setTxError] = useState<string>('');
const [txError, setTxError] = useState<string>();
const [isTxErrorDialogOpen, setIsTxErrorDialogOpen] = useState(false);
const [ethGasPrice, setEthGasPrice] = useState<BigNumber | null>();
const [ethGasLimit, setEthGasLimit] = useState<BigNumber>();
@ -655,7 +655,7 @@ const ApproveTransfer = ({ route }: SignRequestProps) => {
</>
)}
<TxErrorDialog
error={txError}
error={txError!}
visible={isTxErrorDialogOpen}
hideDialog={() => {
setIsTxErrorDialogOpen(false);