1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-11-24 19:10:22 +01:00

Fixing Dapp link on NFT import screen (#19799)

This commit is contained in:
ryanml 2023-07-26 01:28:16 -07:00 committed by GitHub
parent 98279b6592
commit d262acb3a4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -106,9 +106,12 @@ const ConfirmAddSuggestedNFT = () => {
}, [history, mostRecentOverviewPage, suggestedNfts]);
let origin;
let link;
if (suggestedNfts.length) {
try {
origin = new URL(suggestedNfts[0].origin)?.host;
const url = new URL(suggestedNfts[0].origin);
origin = url.host;
link = url.href;
} catch {
origin = 'dapp';
}
@ -138,7 +141,7 @@ const ConfirmAddSuggestedNFT = () => {
<ButtonLink
key={origin}
size={BUTTON_SIZES.INHERIT}
href={origin}
href={link}
target="_blank"
>
{origin}