This commit is contained in:
Alejandro Gomez 2023-02-10 01:38:45 +01:00
parent cae91d273b
commit 8035c8908d
No known key found for this signature in database
GPG Key ID: 4DF39E566658C817

View File

@ -15,7 +15,11 @@ interface RelaysProps {
}
const RelayFavicon = ({ url }: { url: string }) => {
const cleanUrl = url.replace("wss://relay.", "https://").replace("wss://nostr.", "https://");
const cleanUrl = url
.replace("wss://relay.", "https://")
.replace("wss://nostr.", "https://")
.replace("wss://", "https://")
.replace(/\/$/, "");
const [faviconUrl, setFaviconUrl] = useState(`${cleanUrl}/favicon.ico`);
return <img className="favicon" src={faviconUrl} onError={() => setFaviconUrl(Nostrich)} />;