From 80ac2183768101241858fe46c5806d6ce670378d Mon Sep 17 00:00:00 2001 From: Sam Date: Mon, 27 Mar 2023 04:43:39 +0200 Subject: [PATCH] feat(frontend): don't make link a link if it's not a link --- frontend/src/routes/@[username]/ProfileLink.svelte | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/frontend/src/routes/@[username]/ProfileLink.svelte b/frontend/src/routes/@[username]/ProfileLink.svelte index a7bc5f9..22a80eb 100644 --- a/frontend/src/routes/@[username]/ProfileLink.svelte +++ b/frontend/src/routes/@[username]/ProfileLink.svelte @@ -6,6 +6,9 @@ let displayLink: string; $: displayLink = prettifyLink(link); + let isLink = true; + $: isLink = link.startsWith("http://") || link.startsWith("https://"); + const prettifyLink = (raw: string) => { let out = raw; if (raw.startsWith("https://")) out = raw.substring("https://".length); @@ -17,5 +20,9 @@ }; - -{displayLink} + +{#if isLink} + {displayLink} +{:else} + {link} +{/if}