1
0
Fork 0
mirror of https://github.com/mealie-recipes/mealie.git synced 2025-07-23 15: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" :recipe="recipe"
:scale="scale" :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 flat>
<v-card-title>{{ $t('recipe.not-linked-ingredients') }}</v-card-title> <v-card-title>{{ $t('recipe.not-linked-ingredients') }}</v-card-title>
<RecipeIngredients <RecipeIngredients
@ -214,12 +215,10 @@ export default defineComponent({
usePageState(props.recipe.slug); usePageState(props.recipe.slug);
const { deactivateNavigationWarning } = useNavigationWarning(); const { deactivateNavigationWarning } = useNavigationWarning();
const notLinkedIngredients = computed(() => { const notLinkedIngredients = computed(() => {
console.log("inst",props.recipe.recipeInstruction);
return props.recipe.recipeIngredient.filter((ingredient) => { return props.recipe.recipeIngredient.filter((ingredient) => {
return !props.recipe.recipeInstructions.some((step) => step.ingredientReferences?.map((ref) => ref.referenceId).includes(ingredient.referenceId)); return !props.recipe.recipeInstructions.some((step) => step.ingredientReferences?.map((ref) => ref.referenceId).includes(ingredient.referenceId));
}) })
}) })
console.log(notLinkedIngredients);
/** ============================================================= /** =============================================================
* Recipe Snapshot on Mount * Recipe Snapshot on Mount

View file

@ -338,7 +338,7 @@ export default defineComponent({
}, },
setup(props, context) { setup(props, context) {
const { i18n, req, $vuetify } = useContext(); const { i18n, req } = useContext();
const BASE_URL = detectServerBaseUrl(req); const BASE_URL = detectServerBaseUrl(req);
const { isCookMode, toggleCookMode, isEditForm } = usePageState(props.recipe.slug); const { isCookMode, toggleCookMode, isEditForm } = usePageState(props.recipe.slug);