From ce77ceebcda5db71b5e87c4585e75c84b6d77ea0 Mon Sep 17 00:00:00 2001 From: Andrea Vos Date: Wed, 7 Feb 2024 20:26:25 +0100 Subject: [PATCH] (profile)(fix) better handling of custom opinions when listing pronouns on pronouns.page/@username --- routes/profile.vue | 26 +++++++++++++++++++------- 1 file changed, 19 insertions(+), 7 deletions(-) diff --git a/routes/profile.vue b/routes/profile.vue index b6a121618..6756a0d92 100644 --- a/routes/profile.vue +++ b/routes/profile.vue @@ -215,7 +215,7 @@
= 0) { - best.push(pronoun); + for (const { value: pronoun, opinion } of profile.pronouns) { + const opinionValue = opinions[opinion]?.value; + if (opinionValue !== undefined) { + if (opinionValue >= 0) { + best.push(pronoun); + } + } else { + const customOpinion = profile.opinions[opinion]; + if (customOpinion !== undefined + && customOpinion.colour !== 'grey' + && customOpinion.style !== 'small' + && !['ban', 'slash'].includes() + && (!customOpinion.icon || '').endsWith('-slash') + ) { + best.push(pronoun); + } } }