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] = const [cosmosStargateClient, setCosmosStargateClient] =
useState<LaconicClient>(); useState<LaconicClient>();
const [cosmosGasLimit, setCosmosGasLimit] = useState<string>(''); const [cosmosGasLimit, setCosmosGasLimit] = useState<string>('');
const [fees, setFees] = useState<string>(''); const [fees, setFees] = useState<string>();
const [txError, setTxError] = useState<string>(''); const [txError, setTxError] = useState<string>();
const [isTxErrorDialogOpen, setIsTxErrorDialogOpen] = useState(false); const [isTxErrorDialogOpen, setIsTxErrorDialogOpen] = useState(false);
const [isRequestAccepted, setIsRequestAccepted] = useState(false); const [isRequestAccepted, setIsRequestAccepted] = useState(false);
@ -197,7 +197,7 @@ const ApproveTransaction = ({ route }: ApproveTransactionProps) => {
// This amount is total fees required for transaction // This amount is total fees required for transaction
amount: [ amount: [
{ {
amount: fees, amount: fees!,
denom: requestedNetwork!.nativeDenom!, denom: requestedNetwork!.nativeDenom!,
}, },
], ],
@ -299,7 +299,7 @@ const ApproveTransaction = ({ route }: ApproveTransactionProps) => {
</> </>
</ScrollView> </ScrollView>
<TxErrorDialog <TxErrorDialog
error={txError} error={txError!}
visible={isTxErrorDialogOpen} visible={isTxErrorDialogOpen}
hideDialog={async () => { hideDialog={async () => {
setIsTxErrorDialogOpen(false); setIsTxErrorDialogOpen(false);

View File

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