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:
parent
98279b6592
commit
d262acb3a4
@ -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}
|
||||
|
Loading…
Reference in New Issue
Block a user