[ENG-3455] fix: Fix the sharp fee change on tx confirmation

This commit is contained in:
Denys Hriaznov
2023-12-18 13:08:11 +01:00
parent 71772d9912
commit bc96e5be36
3 changed files with 13 additions and 7 deletions

View File

@@ -13,7 +13,7 @@ import { deserializeTransaction } from '@stacks/transactions';
import { useMutation } from '@tanstack/react-query';
import { isLedgerAccount } from '@utils/helper';
import BigNumber from 'bignumber.js';
import { useEffect } from 'react';
import { useEffect, useMemo } from 'react';
import { useTranslation } from 'react-i18next';
import { useLocation, useNavigate } from 'react-router-dom';
@@ -22,8 +22,14 @@ function ConfirmFtTransaction() {
const navigate = useNavigate();
const selectedNetwork = useNetworkSelector();
const location = useLocation();
const { unsignedTx: seedHex, amount, fungibleToken, memo, recepientAddress } = location.state;
const unsignedTx = deserializeTransaction(seedHex);
const {
unsignedTx: unsignedTxHex,
amount,
fungibleToken,
memo,
recepientAddress,
} = location.state;
const unsignedTx = useMemo(() => deserializeTransaction(unsignedTxHex), [unsignedTxHex]);
const { refetch } = useStxWalletData();
const { network, selectedAccount } = useWalletSelector();

View File

@@ -17,7 +17,7 @@ import { deserializeTransaction } from '@stacks/transactions';
import { useMutation } from '@tanstack/react-query';
import { isLedgerAccount } from '@utils/helper';
import BigNumber from 'bignumber.js';
import { useEffect } from 'react';
import { useEffect, useMemo } from 'react';
import { useTranslation } from 'react-i18next';
import { useLocation, useNavigate, useParams } from 'react-router-dom';
import styled from 'styled-components';
@@ -74,7 +74,7 @@ function ConfirmNftTransaction() {
const nft = nftDetailQuery.data?.data;
const { unsignedTx: unsignedTxHex, recipientAddress } = location.state;
const unsignedTx = deserializeTransaction(unsignedTxHex);
const unsignedTx = useMemo(() => deserializeTransaction(unsignedTxHex), [unsignedTxHex]);
const { network } = useWalletSelector();
const { refetch } = useStxWalletData();
const selectedNetwork = useNetworkSelector();

View File

@@ -24,7 +24,7 @@ import { deserializeTransaction } from '@stacks/transactions';
import { useMutation } from '@tanstack/react-query';
import { isLedgerAccount } from '@utils/helper';
import BigNumber from 'bignumber.js';
import { useEffect, useState } from 'react';
import { useEffect, useMemo, useState } from 'react';
import { useTranslation } from 'react-i18next';
import { useLocation, useNavigate } from 'react-router-dom';
import styled from 'styled-components';
@@ -49,7 +49,7 @@ function ConfirmStxTransaction() {
const location = useLocation();
const selectedNetwork = useNetworkSelector();
const { unsignedTx: stringHex, sponsored, isBrowserTx, tabId, requestToken } = location.state;
const unsignedTx = deserializeTransaction(stringHex);
const unsignedTx = useMemo(() => deserializeTransaction(stringHex), [stringHex]);
useOnOriginTabClose(Number(tabId), () => {
setHasTabClosed(true);
window.scrollTo({ top: 0, behavior: 'smooth' });