From fc55086d2fcc974e79ea72c0a411ea1472d77766 Mon Sep 17 00:00:00 2001 From: William Muli <48117473+muliswilliam@users.noreply.github.com> Date: Tue, 13 Aug 2024 15:43:06 +0300 Subject: [PATCH] Refactor to parse URL and replace hostname (#144) --- scripts/util.cjs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/scripts/util.cjs b/scripts/util.cjs index fdba7dd..418e1a1 100644 --- a/scripts/util.cjs +++ b/scripts/util.cjs @@ -470,7 +470,9 @@ const generateDappListsForChain = async (chain) => { // Remove socialLinks and fullDescription from each dApp object dapps.results = dapps.results.map((dapp) => { const { socialLinks, fullDescription, logo, ...filteredDapp } = dapp - filteredDapp.logo = logo.replace('dashboard-assets.dappradar.com', 'dashboard-assets-dappradar.wallet.brave.com') + const logoUrl = new URL(logo) + logoUrl.hostname = 'dashboard-assets-dappradar.wallet.brave.com' + filteredDapp.logo = logoUrl.toString() return filteredDapp })