From 6ac15085ffade58bc55e6a4120a9100ded634cc8 Mon Sep 17 00:00:00 2001 From: Isha Date: Fri, 8 Nov 2024 10:34:47 +0530 Subject: [PATCH] Disable no button after tx is approved --- src/screens/WalletEmbed.tsx | 20 +++++--------------- 1 file changed, 5 insertions(+), 15 deletions(-) diff --git a/src/screens/WalletEmbed.tsx b/src/screens/WalletEmbed.tsx index 8873e51..2a8d2f9 100644 --- a/src/screens/WalletEmbed.tsx +++ b/src/screens/WalletEmbed.tsx @@ -1,5 +1,4 @@ import React, { useEffect, useState, useCallback, useRef } from 'react'; - import { ScrollView, View } from 'react-native'; import { Button, @@ -153,10 +152,6 @@ export const WalletEmbed = () => { network!.nativeDenom!.toLowerCase(), ); - const gasPrice = GasPrice.fromString( - network.gasPrice! + network.nativeDenom, - ); - const sendMsg = { typeUrl: '/cosmos.bank.v1beta1.MsgSend', value: { @@ -171,20 +166,15 @@ export const WalletEmbed = () => { }, }; - const gasEstimation = await client.simulate( - fromAddress, - [sendMsg], - MEMO, - ); - + const gasEstimation = await client.simulate(fromAddress, [sendMsg], MEMO); const gasLimit = String( Math.round(gasEstimation * Number(process.env.REACT_APP_GAS_ADJUSTMENT)), ) - - const cosmosFees = calculateFee(Number(gasLimit), gasPrice); setGasLimit(gasLimit); - + + const gasPrice = GasPrice.fromString(network.gasPrice! + network.nativeDenom); + const cosmosFees = calculateFee(Number(gasLimit), gasPrice); setFees(cosmosFees.amount[0].amount); setTransactionDetails({ @@ -319,13 +309,13 @@ export const WalletEmbed = () => { mode="contained" onPress={rejectRequestHandler} buttonColor="#B82B0D" + disabled={isTxLoading} > No ) : null} -