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
No known key found for this signature in database
GPG Key ID: B4EF20DDE721CAA1
1 changed files with 8 additions and 2 deletions

View File

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