From d847272f93b0ae0570ccde0780032f010d38bb84 Mon Sep 17 00:00:00 2001 From: ryanml Date: Wed, 26 Jul 2023 01:28:16 -0700 Subject: [PATCH] Fixing Dapp link on NFT import screen (#19799) --- .../confirm-add-suggested-nft/confirm-add-suggested-nft.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/ui/pages/confirm-add-suggested-nft/confirm-add-suggested-nft.js b/ui/pages/confirm-add-suggested-nft/confirm-add-suggested-nft.js index f74dd27e9..d3e4aa6ad 100644 --- a/ui/pages/confirm-add-suggested-nft/confirm-add-suggested-nft.js +++ b/ui/pages/confirm-add-suggested-nft/confirm-add-suggested-nft.js @@ -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 = () => { {origin}