diff --git a/src/popup/router/components/TransactionItem.vue b/src/popup/router/components/TransactionItem.vue index 7499c95ce..7438dcffd 100644 --- a/src/popup/router/components/TransactionItem.vue +++ b/src/popup/router/components/TransactionItem.vue @@ -79,7 +79,7 @@ export default { transaction: { type: Object, required: true }, }, computed: { - ...mapGetters(['account', 'getAmountFiat']), + ...mapGetters(['account', 'getAmountFiat', 'activeNetwork']), labels() { if (this.txType && this.txType?.startsWith('name')) { return ['AENS', this.$t('transaction.type')[this.txType]]; @@ -95,7 +95,13 @@ export default { ? this.$t('transaction.dexType.pool') : this.$t('transaction.dexType.swap')]; } - if (this.txType === (SCHEMA.TX_TYPE.contractCall) + if ((this.transaction.tx.contractId + && (this.activeNetwork.tipContractV1 === this.transaction.tx.contractId + || this.activeNetwork.tipContractV2 === this.transaction.tx.contractId) + && (this.transaction.tx.function === 'tip' || this.transaction.tx.function === 'retip')) || this.transaction.claim) { + return [this.$t('pages.token-details.tip'), this.transaction.claim ? this.$t('transaction.spendType.in') : this.$t('transaction.spendType.out')]; + } + if (this.txType === SCHEMA.TX_TYPE.contractCall && this.availableTokens[this.transaction.tx.contractId] && (this.transaction.tx.function === 'transfer' || this.transaction.incomplete)) { return [this.$t('transaction.type.spendTx'), this.transaction.tx.callerId === this.account.address diff --git a/src/popup/router/pages/Retip.vue b/src/popup/router/pages/Retip.vue index eca9fc823..ff1d82988 100644 --- a/src/popup/router/pages/Retip.vue +++ b/src/popup/router/pages/Retip.vue @@ -127,6 +127,7 @@ export default { contractId: this.tippingContract.deployInfo.address, type: SCHEMA.TX_TYPE.contractCall, function: 'retip', + selectedTokenId: this.selectedToken?.contractId, }, }); this.openCallbackOrGoHome(true); diff --git a/src/popup/router/pages/TipsSend.vue b/src/popup/router/pages/TipsSend.vue index c20ee1161..4449fadb1 100644 --- a/src/popup/router/pages/TipsSend.vue +++ b/src/popup/router/pages/TipsSend.vue @@ -285,6 +285,7 @@ export default { contractId: this.tippingContract.deployInfo.address, type: SCHEMA.TX_TYPE.contractCall, function: 'tip', + selectedTokenId: this.selectedToken?.contractId, }, }); this.openCallbackOrGoHome(true); diff --git a/src/popup/utils/helper.js b/src/popup/utils/helper.js index ff3f81188..ed126cea5 100644 --- a/src/popup/utils/helper.js +++ b/src/popup/utils/helper.js @@ -158,8 +158,11 @@ export const getBalanceLocalStorage = () => ( export const categorizeContractCallTxObject = (transaction) => { if (transaction.incomplete || ((transaction.tx.function === 'tip' || transaction.tx.function === 'retip') && transaction.pending)) { + if (!transaction.tx?.selectedTokenId && transaction.pending) return null; return { - amount: transaction.amount, token: transaction.tx.contractId, to: transaction.tx.callerId, + amount: transaction.amount, + token: transaction.pending ? transaction.tx?.selectedTokenId : transaction.tx.contractId, + to: transaction.tx.callerId, }; } if (transaction.tx.type !== 'ContractCallTx') return null;