From cf265ed7ef7c0632bfe3a8b36673fc87e3c27783 Mon Sep 17 00:00:00 2001 From: Guillaume Roux Date: Wed, 26 Oct 2022 11:09:32 +0200 Subject: [PATCH] [FLASK] Allow snaps insights to show on regular EOA transactions (#16093) --- .../confirm-page-container-content.component.js | 8 +++++--- .../confirm-transaction-base.component.js | 12 ++++++++---- 2 files changed, 13 insertions(+), 7 deletions(-) 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 be48015a5..b7cd74218 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 @@ -102,9 +102,11 @@ export default class ConfirmPageContainerContent extends Component { > {detailsComponent} - - {dataComponent} - + {dataComponent && ( + + {dataComponent} + + )} {dataHexComponent && ( id === selectedInsightSnapId, ); + const allowedTransactionTypes = + txData.type === TRANSACTION_TYPES.CONTRACT_INTERACTION || + txData.type === TRANSACTION_TYPES.SIMPLE_SEND || + txData.type === TRANSACTION_TYPES.TOKEN_METHOD_SAFE_TRANSFER_FROM || + txData.type === TRANSACTION_TYPES.TOKEN_METHOD_TRANSFER_FROM || + txData.type === TRANSACTION_TYPES.TOKEN_METHOD_TRANSFER; + const networkId = CHAIN_ID_TO_NETWORK_ID_MAP[chainId]; const caip2ChainId = `eip155:${networkId ?? stripHexPrefix(chainId)}`; - if ( - txData.type !== TRANSACTION_TYPES.CONTRACT_INTERACTION || - !insightSnaps.length - ) { + if (!allowedTransactionTypes || !insightSnaps.length) { return null; }