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:
parent
622c1b11f5
commit
b1f81b4b95
2 changed files with 4 additions and 5 deletions
|
@ -104,8 +104,9 @@
|
||||||
:recipe="recipe"
|
:recipe="recipe"
|
||||||
:scale="scale"
|
:scale="scale"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
|
<div v-if="notLinkedIngredients.length > 0" class="px-2 px-md-4 pb-4 ">
|
||||||
<v-divider></v-divider>
|
<v-divider></v-divider>
|
||||||
<div class="px-2 px-md-4 pb-4 ">
|
|
||||||
<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
|
||||||
|
|
|
@ -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);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue