mirror of
https://gitlab.com/PronounsPage/PronounsPage.git
synced 2025-09-23 20:54:48 -04:00
(profile)(fix) better handling of custom opinions when listing pronouns on pronouns.page/@username
This commit is contained in:
parent
9a6128df96
commit
ce77ceebcd
@ -215,7 +215,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="d-flex align-items-center">
|
<div class="d-flex align-items-center">
|
||||||
<ForeignPronoun
|
<ForeignPronoun
|
||||||
v-for="pronoun in selectMainPronouns(user.profiles[locale].pronouns)"
|
v-for="pronoun in selectMainPronouns(user.profiles[locale])"
|
||||||
:key="pronoun"
|
:key="pronoun"
|
||||||
:pronoun="pronoun"
|
:pronoun="pronoun"
|
||||||
:locale="locale"
|
:locale="locale"
|
||||||
@ -253,7 +253,7 @@ export default {
|
|||||||
mixins: [mainPronoun],
|
mixins: [mainPronoun],
|
||||||
async asyncData({ app, route }) {
|
async asyncData({ app, route }) {
|
||||||
return {
|
return {
|
||||||
user: await app.$axios.$get(`/profile/get/${encodeURIComponent(route.params.pathMatch)}?version=2&props=pronouns,flags&lprops[${app.context.env.LOCALE}]=all`),
|
user: await app.$axios.$get(`/profile/get/${encodeURIComponent(route.params.pathMatch)}?version=2&props=pronouns,flags,opinions&lprops[${app.context.env.LOCALE}]=all`),
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
@ -359,12 +359,24 @@ export default {
|
|||||||
clearInterval(this.cardCheckHandle);
|
clearInterval(this.cardCheckHandle);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
selectMainPronouns(pronouns) {
|
selectMainPronouns(profile) {
|
||||||
const best = [];
|
const best = [];
|
||||||
for (const { value: pronoun, opinion } of pronouns) {
|
for (const { value: pronoun, opinion } of profile.pronouns) {
|
||||||
const opinionValue = opinions[opinion]?.value || 0;
|
const opinionValue = opinions[opinion]?.value;
|
||||||
if (opinionValue >= 0) {
|
if (opinionValue !== undefined) {
|
||||||
best.push(pronoun);
|
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);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user