diff --git a/app/_locales/en/messages.json b/app/_locales/en/messages.json index 55859b47c..aefa0a070 100644 --- a/app/_locales/en/messages.json +++ b/app/_locales/en/messages.json @@ -3143,6 +3143,9 @@ "twelveHrTitle": { "message": "12hr:" }, + "txInsightsNotSupported": { + "message": "Transaction insights not supported for this contract at this time." + }, "typePassword": { "message": "Type your MetaMask password" }, diff --git a/ui/components/app/confirm-page-container/confirm-page-container-content/confirm-page-container-content.component.js b/ui/components/app/confirm-page-container/confirm-page-container-content/confirm-page-container-content.component.js index 346864d96..45a9a6daf 100644 --- a/ui/components/app/confirm-page-container/confirm-page-container-content/confirm-page-container-content.component.js +++ b/ui/components/app/confirm-page-container/confirm-page-container-content/confirm-page-container-content.component.js @@ -68,12 +68,14 @@ export default class ConfirmPageContainerContent extends Component { {dataComponent} - - {dataHexComponent} - + {dataHexComponent && ( + + {dataHexComponent} + + )} ); } diff --git a/ui/components/app/transaction-decoding/index.scss b/ui/components/app/transaction-decoding/index.scss index 43abeb82b..2416e04d9 100644 --- a/ui/components/app/transaction-decoding/index.scss +++ b/ui/components/app/transaction-decoding/index.scss @@ -37,7 +37,9 @@ } } - + &-error { + cursor: auto; + } .tx-insight-content { &__tree-component { diff --git a/ui/components/app/transaction-decoding/transaction-decoding.component.js b/ui/components/app/transaction-decoding/transaction-decoding.component.js index e025efbd6..e96f1d8d2 100644 --- a/ui/components/app/transaction-decoding/transaction-decoding.component.js +++ b/ui/components/app/transaction-decoding/transaction-decoding.component.js @@ -79,7 +79,11 @@ export default function TransactionDecoding({ to = '', inputData: data = '' }) { } catch (error) { setLoading(false); setError(true); - setErrorMessage(error?.message); + if (error?.message.match('400')) { + setErrorMessage(t('txInsightsNotSupported')); + } else { + setErrorMessage(error?.message); + } } })(); }, [t, from, to, network, data]); diff --git a/ui/components/app/transaction-list-item-details/transaction-list-item-details.component.js b/ui/components/app/transaction-list-item-details/transaction-list-item-details.component.js index 4dc58919a..6fe04de97 100644 --- a/ui/components/app/transaction-list-item-details/transaction-list-item-details.component.js +++ b/ui/components/app/transaction-list-item-details/transaction-list-item-details.component.js @@ -252,15 +252,18 @@ export default class TransactionListItemDetails extends PureComponent { primaryCurrency={primaryCurrency} className="transaction-list-item-details__transaction-breakdown" /> - - - + {transactionGroup.initialTransaction.type !== + TRANSACTION_TYPES.INCOMING && ( + + + + )} {transactionGroup.initialTransaction?.txParams?.data ? ( type).join(', ')})` + : ''; + return ( dataComponent || (
{`${t('functionType')}:`} - {functionType} + {`${functionType} ${functionParams}`}
@@ -670,12 +679,12 @@ export default class ConfirmTransactionBase extends Component { dataHexComponent, } = this.props; - if (hideData) { + if (hideData || !txParams.to) { return null; } - const functionParams = params - ? `(${params.map(({ type }) => type).join(', ')}` + const functionParams = params?.length + ? `(${params.map(({ type }) => type).join(', ')})` : ''; return (