Merge pull request #10 from mars-protocol/hotfix/tx-hashes

fix: fixed the tx hashes for station wallet
This commit is contained in:
Linkie Link 2023-02-13 15:59:11 +01:00 committed by GitHub
commit e40a1f8adb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 6 additions and 14 deletions

View File

@ -136,6 +136,8 @@ export const IncentivesButton = () => {
}
}
const transactionHash = response?.hash || ''
if (!userWalletAddress) return null
return (
@ -174,10 +176,7 @@ export const IncentivesButton = () => {
{response ? (
<div className={`${styles.container} ${styles.info}`}>
<p className='m'>{t('incentives.successfullyClaimed')}</p>
<TxLink
hash={response?.hash || ''}
link={`${explorerUrl}/txs/${response?.hash}`}
/>
<TxLink hash={transactionHash} link={`${explorerUrl}/txs/${transactionHash}`} />
</div>
) : (
<div className={styles.container}>

View File

@ -16,7 +16,6 @@ interface Props {
export const TxFailedContent = ({ message, hash, handleClose }: Props) => {
const chainInfo = useStore((s) => s.chainInfo)
const explorerUrl = chainInfo && SimpleChainInfoList[chainInfo.chainId as ChainInfoID].explorer
const { t } = useTranslation()
return (

View File

@ -76,11 +76,7 @@ export const TxResponse = ({
return (
<Card isClose={true} onClick={handleClose} title={cardTitle}>
{txStatus === TxStatus.FAILURE ? (
<TxFailedContent
handleClose={handleClose}
hash={response?.response.transactionHash || ''}
message={error}
/>
<TxFailedContent handleClose={handleClose} hash={response?.hash || ''} message={error} />
) : (
<TxSuccessContent
handleClose={handleClose}

View File

@ -27,6 +27,7 @@ export const TxSuccessContent = ({
const { t } = useTranslation()
const chainInfo = useStore((s) => s.chainInfo)
const explorerUrl = chainInfo && SimpleChainInfoList[chainInfo.chainId as ChainInfoID].explorer
const transactionHash = response?.hash || ''
return (
<div className={styles.container}>
@ -65,10 +66,7 @@ export const TxSuccessContent = ({
</div>
<div className={styles.item}>
<div className={styles.label}>{t('common.txHash')}</div>
<TxLink
hash={response?.response.transactionHash || ''}
link={`${explorerUrl}/txs/${response?.response.transactionHash}`}
/>
<TxLink hash={transactionHash} link={`${explorerUrl}/txs/${transactionHash}`} />
</div>
</div>
)}