diff --git a/components/ExampleCategoryListItem.vue b/components/ExampleCategoryListItem.vue index bb2d6f09a..1b4bc6f6d 100644 --- a/components/ExampleCategoryListItem.vue +++ b/components/ExampleCategoryListItem.vue @@ -24,18 +24,13 @@ const example = computed(() => { const pronoun = ref(); -const exampleValues = computed(() => { - if (pronoun.value === undefined) { - return undefined; - } - return { morphemeValues: pronoun.value.toMorphemeValues(props.counter) }; -}); +const exampleValues = computed(() => pronoun.value?.toExampleValues(props.counter)); const suitablePronounExamples = computed((): PronounExample[] => { return props.exampleCategory.examples.filter((pronounExample) => { return props.pronounsChoice.some((pronoun) => { const example = pronounExample.example(pronoun, props.counter); - return example.requiredMorphemesPresent(pronoun.toMorphemeValues(props.counter)); + return example.areRequiredExampleValuesPresent(pronoun.toExampleValues(props.counter)); }); }); }); @@ -64,7 +59,7 @@ const selectDifferentExample = (): void => { const selectPronounForExample = (forceDifferent: boolean): void => { const suitablePronouns = props.pronounsChoice.filter((otherPronoun) => { - return example.value.requiredMorphemesPresent(otherPronoun.toMorphemeValues()) && + return example.value.areRequiredExampleValuesPresent(otherPronoun.toExampleValues()) && (!forceDifferent || otherPronoun !== toRaw(pronoun.value)); }); pronoun.value = randomItem(suitablePronouns); diff --git a/components/MorphemeWithPronunciation.vue b/components/MorphemeWithPronunciation.vue index 253a8d31f..b18c52513 100644 --- a/components/MorphemeWithPronunciation.vue +++ b/components/MorphemeWithPronunciation.vue @@ -30,7 +30,7 @@ const pronunciation = computed(() => { const visibleExamples = computed(() => { return props.examples?.filter((example) => { - return example.requiredMorphemesPresent(props.exampleValues.morphemeValues) && + return example.areRequiredExampleValuesPresent(props.exampleValues) && [...props.highlightsMorphemes.values()].some((morpheme) => example.hasMorpheme(morpheme)); }); }); diff --git a/components/pronouns/PronounsMorphemeWithPronunciation.vue b/components/pronouns/PronounsMorphemeWithPronunciation.vue index 6c9214df0..9eb65f36f 100644 --- a/components/pronouns/PronounsMorphemeWithPronunciation.vue +++ b/components/pronouns/PronounsMorphemeWithPronunciation.vue @@ -33,7 +33,7 @@ const examples = computed((): Example[] => {