fix(backend): don't try to link to malformed pronouns

This commit is contained in:
Sam 2023-03-14 01:33:11 +01:00
parent fb8733befa
commit 5ee069a5bd
Signed by: sam
GPG key ID: B4EF20DDE721CAA1

View file

@ -9,8 +9,14 @@
} else {
const split = pronouns.pronouns.split("/");
if (split.length < 2) pronounText = split.join("/");
else pronounText = split.slice(0, 2).join("/")
else pronounText = split.slice(0, 2).join("/");
}
const shouldLink = pronouns.pronouns.split("/").length === 5;
</script>
<a href="/pronouns/{pronouns.pronouns}">{pronounText}</a>
{#if shouldLink}
<a href="/pronouns/{pronouns.pronouns}">{pronounText}</a>
{:else}
{pronounText}
{/if}