Skip to content

Commit

Permalink
feat: changed to go to the history page immediately upon sending a tr…
Browse files Browse the repository at this point in the history
…ansaction
  • Loading branch information
jinoosss committed Nov 6, 2024
1 parent 01851db commit 87121fd
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import React, { useCallback, useState } from 'react';
import { useNavigate } from 'react-router-dom';
import styled from 'styled-components';

import { DEFAULT_GAS_WANTED } from '@common/constants/tx.constant';
import NFTTransferSummary from '@components/pages/nft-transfer-summary/nft-transfer-summary/nft-transfer-summary';
import { useGetGRC721TokenUri } from '@hooks/nft/use-get-grc721-token-uri';
import useAppNavigate from '@hooks/use-app-navigate';
Expand Down Expand Up @@ -52,14 +53,13 @@ const NFTTransferSummaryContainer: React.FC = () => {
return null;
}
const { grc721Token, toAddress, networkFee, memo } = summaryInfo;
const GAS_WANTED = 1000000;
const message = makeGRC721TransferMessage(grc721Token, currentAddress, toAddress);
const networkFeeAmount = BigNumber(networkFee.value).shiftedBy(6).toNumber();
const document = await transactionService.createDocument(
currentAccount,
currentNetwork.networkId,
[message],
GAS_WANTED,
DEFAULT_GAS_WANTED,
networkFeeAmount,
memo,
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { useNavigate } from 'react-router-dom';
import styled from 'styled-components';

import UnknownTokenIcon from '@assets/common-unknown-token.svg';
import { DEFAULT_GAS_WANTED } from '@common/constants/tx.constant';
import { isGRC20TokenModel, isNativeTokenModel } from '@common/validation/validation-token';
import TransferSummary from '@components/pages/transfer-summary/transfer-summary/transfer-summary';
import useAppNavigate from '@hooks/use-app-navigate';
Expand Down Expand Up @@ -80,15 +81,14 @@ const TransferSummaryContainer: React.FC = () => {
return null;
}
const { tokenMetainfo, networkFee } = summaryInfo;
const GAS_WANTED = 1000000;
const message =
tokenMetainfo.type === 'gno-native' ? getNativeTransferMessage() : getGRC20TransferMessage();
const networkFeeAmount = BigNumber(networkFee.value).shiftedBy(6).toNumber();
const document = await transactionService.createDocument(
currentAccount,
currentNetwork.networkId,
[message],
GAS_WANTED,
DEFAULT_GAS_WANTED,
networkFeeAmount,
summaryInfo.memo,
);
Expand Down Expand Up @@ -140,10 +140,8 @@ const TransferSummaryContainer: React.FC = () => {

const transferByCommon = useCallback(async () => {
try {
const result = await createTransaction();
if (result) {
navigate(RoutePath.History);
}
createTransaction();
navigate(RoutePath.History);
} catch (e) {
if (!(e instanceof Error)) {
return false;
Expand Down

0 comments on commit 87121fd

Please sign in to comment.