1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-11-25 03:20:23 +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 Mark Stacey
parent 9323701f9b
commit d847272f93

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}