mirror of
https://gitlab.com/PronounsPage/PronounsPage.git
synced 2025-09-24 05:05:20 -04:00
(pronouns) don't show "duplicate" pronouns (eg. they/them/themself vs they/them/themselves) in generator
This commit is contained in:
parent
b3dcabdd04
commit
c4117d258c
@ -54,9 +54,9 @@
|
||||
<li class="list-inline-item">
|
||||
<Spelling :text="group.name"/>
|
||||
</li>
|
||||
<li class="list-inline-item" v-for="(pronoun, pronounName) in groupPronouns">
|
||||
<li class="list-inline-item" v-for="pronoun in deduplicatePronounGroup(groupPronouns)">
|
||||
<button :class="['btn', pronoun.name(glue) === selectedPronoun.name(glue) ? 'btn-primary' : 'btn-outline-primary', 'btn-sm', 'my-1']"
|
||||
@click="selectedPronoun = groupPronouns[pronounName].clone(true)"
|
||||
@click="selectedPronoun = pronoun.clone(true)"
|
||||
>
|
||||
<Spelling :text="pronoun.name(glue)"/>
|
||||
</button>
|
||||
@ -334,6 +334,14 @@
|
||||
clearExampleParts(parts) {
|
||||
return parts.map(p => new ExamplePart(p.variable, p.str.replace(/^'/, '')));
|
||||
},
|
||||
deduplicatePronounGroup(pronounGroup) {
|
||||
const dict = {};
|
||||
for (let pronoun of pronounGroup) {
|
||||
if (dict.hasOwnProperty(pronoun.name(this.glue))) { continue; }
|
||||
dict[pronoun.name(this.glue)] = pronoun;
|
||||
}
|
||||
return Object.values(dict);
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
Loading…
x
Reference in New Issue
Block a user