1
0
Fork 0
mirror of https://github.com/mealie-recipes/mealie.git synced 2025-07-19 13:19:41 +02:00

fix: Cookmode hide additional ingredients if all ingredients are linked (#4539)

This commit is contained in:
Kuchenpirat 2024-11-12 16:12:41 +01:00 committed by GitHub
parent 622c1b11f5
commit b1f81b4b95
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 4 additions and 5 deletions

View file

@ -104,8 +104,9 @@
:recipe="recipe"
:scale="scale"
/>
<v-divider></v-divider>
<div class="px-2 px-md-4 pb-4 ">
<div v-if="notLinkedIngredients.length > 0" class="px-2 px-md-4 pb-4 ">
<v-divider></v-divider>
<v-card flat>
<v-card-title>{{ $t('recipe.not-linked-ingredients') }}</v-card-title>
<RecipeIngredients
@ -214,12 +215,10 @@ export default defineComponent({
usePageState(props.recipe.slug);
const { deactivateNavigationWarning } = useNavigationWarning();
const notLinkedIngredients = computed(() => {
console.log("inst",props.recipe.recipeInstruction);
return props.recipe.recipeIngredient.filter((ingredient) => {
return !props.recipe.recipeInstructions.some((step) => step.ingredientReferences?.map((ref) => ref.referenceId).includes(ingredient.referenceId));
})
})
console.log(notLinkedIngredients);
/** =============================================================
* Recipe Snapshot on Mount