diff --git a/ui/components/app/confirm-page-container/confirm-page-container.component.js b/ui/components/app/confirm-page-container/confirm-page-container.component.js index b4ea1a3fb725..bf04534e11a3 100644 --- a/ui/components/app/confirm-page-container/confirm-page-container.component.js +++ b/ui/components/app/confirm-page-container/confirm-page-container.component.js @@ -66,6 +66,7 @@ export default class ConfirmPageContainer extends Component { toMetadataName: PropTypes.string, toEns: PropTypes.string, toNickname: PropTypes.string, + recipientIsOwnedAccount: PropTypes.bool, // Content contentComponent: PropTypes.node, errorKey: PropTypes.string, @@ -135,6 +136,7 @@ export default class ConfirmPageContainer extends Component { toMetadataName, toEns, toNickname, + recipientIsOwnedAccount, toAddress, disabled, errorKey, @@ -247,6 +249,7 @@ export default class ConfirmPageContainer extends Component { recipientAddress={toAddress} recipientEns={toEns} recipientNickname={toNickname} + recipientIsOwnedAccount={recipientIsOwnedAccount} /> )} diff --git a/ui/components/app/confirm-page-container/confirm-page-container.container.js b/ui/components/app/confirm-page-container/confirm-page-container.container.js index 3eb6bf2182db..e090f5562917 100644 --- a/ui/components/app/confirm-page-container/confirm-page-container.container.js +++ b/ui/components/app/confirm-page-container/confirm-page-container.container.js @@ -7,7 +7,6 @@ import { getMetadataContractName, getAccountName, getMetaMaskIdentities, - getAccountsWithLabels, } from '../../../selectors'; import ConfirmPageContainer from './confirm-page-container.component'; @@ -19,7 +18,8 @@ function mapStateToProps(state, ownProps) { const defaultToken = getSwapsDefaultToken(state); const accountBalance = defaultToken.string; const identities = getMetaMaskIdentities(state); - const toName = getAccountName(identities, to) || ownProps.toName; + const ownedAccountName = getAccountName(identities, to); + const toName = ownedAccountName || ownProps.toName; const toMetadataName = getMetadataContractName(state, to); return { @@ -27,9 +27,7 @@ function mapStateToProps(state, ownProps) { contact, toName, toMetadataName, - isOwnedAccount: getAccountsWithLabels(state) - .map((accountWithLabel) => accountWithLabel.address) - .includes(to), + recipientIsOwnedAccount: Boolean(ownedAccountName), to, networkIdentifier, accountBalance, diff --git a/ui/components/ui/sender-to-recipient/sender-to-recipient.component.js b/ui/components/ui/sender-to-recipient/sender-to-recipient.component.js index 6aec343bec93..42ee0d9bd30c 100644 --- a/ui/components/ui/sender-to-recipient/sender-to-recipient.component.js +++ b/ui/components/ui/sender-to-recipient/sender-to-recipient.component.js @@ -104,6 +104,7 @@ export function RecipientWithAddress({ recipientEns, recipientName, recipientMetadataName, + recipientIsOwnedAccount, }) { const t = useI18nContext(); const [showNicknamePopovers, setShowNicknamePopovers] = useState(false); @@ -127,7 +128,7 @@ export function RecipientWithAddress({