show asset name instead of symbol for setApprovalForAll calls on NFT contracts where possible (#15296)

feature/default_network_editable
Alex Donesky 2 years ago committed by GitHub
parent 6233ed414d
commit 78b32153f5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 10
      ui/pages/confirm-approve/confirm-approve-content/confirm-approve-content.component.js

@ -457,6 +457,7 @@ export default class ConfirmApproveContent extends Component {
chainId,
assetStandard,
tokenSymbol,
isSetApproveForAll,
} = this.props;
const { t } = this.context;
let titleTokenDescription = t('token');
@ -483,7 +484,10 @@ export default class ConfirmApproveContent extends Component {
titleTokenDescription = unknownTokenLink;
}
if (assetStandard === ERC20 || (tokenSymbol && !tokenId)) {
if (
assetStandard === ERC20 ||
(tokenSymbol && !tokenId && !isSetApproveForAll)
) {
titleTokenDescription = tokenSymbol;
} else if (
assetStandard === ERC721 ||
@ -492,9 +496,9 @@ export default class ConfirmApproveContent extends Component {
(assetName && tokenId) ||
(tokenSymbol && tokenId)
) {
const tokenIdWrapped = tokenId ? ` (#${tokenId})` : null;
const tokenIdWrapped = tokenId ? ` (#${tokenId})` : '';
if (assetName || tokenSymbol) {
titleTokenDescription = `${assetName ?? tokenSymbol} ${tokenIdWrapped}`;
titleTokenDescription = `${assetName ?? tokenSymbol}${tokenIdWrapped}`;
} else {
const unknownNFTBlockExplorerLink = getTokenTrackerLink(
tokenAddress,

Loading…
Cancel
Save