diff --git a/app/components/Views/Asset/index.js b/app/components/Views/Asset/index.js index 1570c80a6a8..629b40f9dd9 100644 --- a/app/components/Views/Asset/index.js +++ b/app/components/Views/Asset/index.js @@ -130,34 +130,40 @@ class Asset extends PureComponent { isTransfer, transferInformation } = tx; - if (isTransfer) - return this.props.tokens.find( - ({ address }) => address.toLowerCase() === transferInformation.contractAddress.toLowerCase() - ); - return ( + + const network = Engine.context.NetworkController.state.network; + if ( (safeToChecksumAddress(from) === selectedAddress || safeToChecksumAddress(to) === selectedAddress) && - chainId === tx.networkID && + (chainId === tx.chainId || (!tx.chainId && network === tx.networkID)) && tx.status !== 'unapproved' - ); + ) { + if (isTransfer) + return this.props.tokens.find( + ({ address }) => address.toLowerCase() === transferInformation.contractAddress.toLowerCase() + ); + return true; + } + return false; }; noEthFilter = tx => { - const { chainId, swapsTransactions } = this.props; + const { chainId, swapsTransactions, selectedAddress } = this.props; const { transaction: { to, from }, isTransfer, transferInformation } = tx; - if (isTransfer) return this.navAddress === transferInformation.contractAddress.toLowerCase(); + const network = Engine.context.NetworkController.state.network; if ( - (from?.toLowerCase() === this.navAddress || to?.toLowerCase() === this.navAddress) && - chainId === tx.networkID && + (safeToChecksumAddress(from) === selectedAddress || safeToChecksumAddress(to) === selectedAddress) && + (chainId === tx.chainId || (!tx.chainId && network === tx.networkID)) && tx.status !== 'unapproved' - ) - return true; - if (swapsTransactions[tx.id] && to?.toLowerCase() === SWAPS_CONTRACT_ADDRESS) { - const { destinationToken, sourceToken } = swapsTransactions[tx.id]; - return destinationToken.address === this.navAddress || sourceToken.address === this.navAddress; + ) { + if (isTransfer) return this.navAddress === transferInformation.contractAddress.toLowerCase(); + if (swapsTransactions[tx.id] && to?.toLowerCase() === SWAPS_CONTRACT_ADDRESS) { + const { destinationToken, sourceToken } = swapsTransactions[tx.id]; + return destinationToken.address === this.navAddress || sourceToken.address === this.navAddress; + } } return false; }; diff --git a/app/components/Views/TransactionsView/index.js b/app/components/Views/TransactionsView/index.js index 08831670647..2505791f026 100644 --- a/app/components/Views/TransactionsView/index.js +++ b/app/components/Views/TransactionsView/index.js @@ -38,15 +38,18 @@ const TransactionsView = ({ isTransfer, transferInformation } = tx; - if (isTransfer) - return tokens.find( - ({ address }) => address.toLowerCase() === transferInformation.contractAddress.toLowerCase() - ); - return ( + if ( (safeToChecksumAddress(from) === selectedAddress || safeToChecksumAddress(to) === selectedAddress) && (chainId === tx.chainId || (!tx.chainId && network === tx.networkID)) && tx.status !== 'unapproved' - ); + ) { + if (isTransfer) + return tokens.find( + ({ address }) => address.toLowerCase() === transferInformation.contractAddress.toLowerCase() + ); + return true; + } + return false; }; const submittedTxs = [];