mirror of
https://github.com/mealie-recipes/mealie.git
synced 2025-11-01 10:43:25 -04:00
fix: Cookmode hide additional ingredients if all ingredients are linked (#4539)
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -338,7 +338,7 @@ export default defineComponent({
|
||||
},
|
||||
|
||||
setup(props, context) {
|
||||
const { i18n, req, $vuetify } = useContext();
|
||||
const { i18n, req } = useContext();
|
||||
const BASE_URL = detectServerBaseUrl(req);
|
||||
|
||||
const { isCookMode, toggleCookMode, isEditForm } = usePageState(props.recipe.slug);
|
||||
|
||||
Reference in New Issue
Block a user