mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-11-22 09:57:02 +01:00
show asset name instead of symbol for setApprovalForAll calls on NFT contracts where possible (#15296)
This commit is contained in:
parent
6233ed414d
commit
78b32153f5
@ -457,6 +457,7 @@ export default class ConfirmApproveContent extends Component {
|
|||||||
chainId,
|
chainId,
|
||||||
assetStandard,
|
assetStandard,
|
||||||
tokenSymbol,
|
tokenSymbol,
|
||||||
|
isSetApproveForAll,
|
||||||
} = this.props;
|
} = this.props;
|
||||||
const { t } = this.context;
|
const { t } = this.context;
|
||||||
let titleTokenDescription = t('token');
|
let titleTokenDescription = t('token');
|
||||||
@ -483,7 +484,10 @@ export default class ConfirmApproveContent extends Component {
|
|||||||
titleTokenDescription = unknownTokenLink;
|
titleTokenDescription = unknownTokenLink;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (assetStandard === ERC20 || (tokenSymbol && !tokenId)) {
|
if (
|
||||||
|
assetStandard === ERC20 ||
|
||||||
|
(tokenSymbol && !tokenId && !isSetApproveForAll)
|
||||||
|
) {
|
||||||
titleTokenDescription = tokenSymbol;
|
titleTokenDescription = tokenSymbol;
|
||||||
} else if (
|
} else if (
|
||||||
assetStandard === ERC721 ||
|
assetStandard === ERC721 ||
|
||||||
@ -492,9 +496,9 @@ export default class ConfirmApproveContent extends Component {
|
|||||||
(assetName && tokenId) ||
|
(assetName && tokenId) ||
|
||||||
(tokenSymbol && tokenId)
|
(tokenSymbol && tokenId)
|
||||||
) {
|
) {
|
||||||
const tokenIdWrapped = tokenId ? ` (#${tokenId})` : null;
|
const tokenIdWrapped = tokenId ? ` (#${tokenId})` : '';
|
||||||
if (assetName || tokenSymbol) {
|
if (assetName || tokenSymbol) {
|
||||||
titleTokenDescription = `${assetName ?? tokenSymbol} ${tokenIdWrapped}`;
|
titleTokenDescription = `${assetName ?? tokenSymbol}${tokenIdWrapped}`;
|
||||||
} else {
|
} else {
|
||||||
const unknownNFTBlockExplorerLink = getTokenTrackerLink(
|
const unknownNFTBlockExplorerLink = getTokenTrackerLink(
|
||||||
tokenAddress,
|
tokenAddress,
|
||||||
|
Loading…
Reference in New Issue
Block a user