Disable no button after tx is approved

This commit is contained in:
Isha 2024-11-08 10:34:47 +05:30
parent 08711b50d6
commit 6ac15085ff

View File

@ -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
</Button>
</View>
</>
) : null}
<TxErrorDialog
error={txError!}
visible={!!txError}