mirror of
https://github.com/zhigang1992/xverse-web-extension.git
synced 2026-01-12 18:02:19 +08:00
[ENG-3455] fix: Fix the sharp fee change on tx confirmation
This commit is contained in:
@@ -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();
|
||||
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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' });
|
||||
|
||||
Reference in New Issue
Block a user