From fc9511619ac1a9c2a26903cec82cb189c2bbb1ee Mon Sep 17 00:00:00 2001 From: Nikita Date: Tue, 18 Feb 2025 17:42:16 +0400 Subject: [PATCH] fix: show asset as unrecognized if so --- src/composables/transactionData.ts | 9 ++++++--- src/popup/components/TransactionDetailsBase.vue | 1 + src/protocols/ethereum/helpers/index.ts | 1 + 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/composables/transactionData.ts b/src/composables/transactionData.ts index 4d44dbd8b..0d367890d 100644 --- a/src/composables/transactionData.ts +++ b/src/composables/transactionData.ts @@ -1,5 +1,7 @@ import { computed, Ref } from 'vue'; import { Tag } from '@aeternity/aepp-sdk'; +import { isEmpty } from 'lodash-es'; + import type { AccountAddress, ITokenResolved, @@ -115,9 +117,10 @@ export function useTransactionData({ const isNonTokenContract = computed( (): boolean => ( - !getProtocolAvailableTokens(protocol.value)[innerTx.value?.contractId] - || innerTxTag.value === Tag.ContractCreateTx - ), + !isEmpty(getProtocolAvailableTokens(protocol.value)) + && !getProtocolAvailableTokens(protocol.value)[innerTx.value?.contractId] + ) + || innerTxTag.value === Tag.ContractCreateTx, ); const isTokenSale = computed( diff --git a/src/popup/components/TransactionDetailsBase.vue b/src/popup/components/TransactionDetailsBase.vue index 251c588a8..db835c407 100644 --- a/src/popup/components/TransactionDetailsBase.vue +++ b/src/popup/components/TransactionDetailsBase.vue @@ -126,6 +126,7 @@ :amount="amount" :symbol="assetSymbol" :hide-fiat="hideFiat" + :hide-symbol="!assetSymbol" :protocol="protocol" :price="price" high-precision diff --git a/src/protocols/ethereum/helpers/index.ts b/src/protocols/ethereum/helpers/index.ts index af2c3083d..108954039 100644 --- a/src/protocols/ethereum/helpers/index.ts +++ b/src/protocols/ethereum/helpers/index.ts @@ -55,6 +55,7 @@ export function normalizeWeb3EthTransactionStructure( senderId: from ? toChecksumAddress(from) : undefined, recipientId: to ? toChecksumAddress(to) : undefined, type: isEthTransfer ? 'SpendTx' : 'ContractCallTx', // TODO: create own types + tag: (isEthTransfer ? 'SpendTx' : 'ContractCallTx') as any, // TODO: create own types arguments: [], callerId: '', contractId,