diff --git a/frontend/components/Domain/Recipe/RecipeActionMenu.vue b/frontend/components/Domain/Recipe/RecipeActionMenu.vue index afa7617dbb7d..2dc804782d51 100644 --- a/frontend/components/Domain/Recipe/RecipeActionMenu.vue +++ b/frontend/components/Domain/Recipe/RecipeActionMenu.vue @@ -63,6 +63,7 @@ mealplanner: loggedIn, shoppingList: loggedIn, print: true, + printPreferences: true, share: loggedIn, publicUrl: recipe.settings && loggedIn ? recipe.settings.public : false, }" diff --git a/frontend/components/Domain/Recipe/RecipeContextMenu.vue b/frontend/components/Domain/Recipe/RecipeContextMenu.vue index c8f0e6ec1de9..fa3aa921ed23 100644 --- a/frontend/components/Domain/Recipe/RecipeContextMenu.vue +++ b/frontend/components/Domain/Recipe/RecipeContextMenu.vue @@ -2,7 +2,7 @@
- + (); const selectedShoppingList = ref(); - const recipe = ref(props.recipe); + const recipeRef = ref(props.recipe); const recipeIngredients = ref<{ checked: boolean; ingredient: RecipeIngredient; display: string }[]>([]); async function getShoppingLists() { @@ -396,22 +396,22 @@ export default defineComponent({ async function refreshRecipe() { const { data } = await api.recipes.getOne(props.slug); if (data) { - recipe.value = data; + recipeRef.value = data; } } async function openShoppingListIngredientDialog(list: ShoppingListSummary) { selectedShoppingList.value = list; - if (!recipe.value) { + if (!recipeRef.value) { await refreshRecipe(); } - if (recipe.value?.recipeIngredient) { - recipeIngredients.value = recipe.value.recipeIngredient.map((ingredient) => { + if (recipeRef.value?.recipeIngredient) { + recipeIngredients.value = recipeRef.value.recipeIngredient.map((ingredient) => { return { checked: true, ingredient, - display: parseIngredientText(ingredient, recipe.value?.settings?.disableAmount || false, props.recipeScale), + display: parseIngredientText(ingredient, recipeRef.value?.settings?.disableAmount || false, props.recipeScale), }; }); } @@ -510,7 +510,10 @@ export default defineComponent({ mealplanner: () => { state.mealplannerDialog = true; }, - printPreferences: () => { + printPreferences: async () => { + if (!recipeRef.value) { + await refreshRecipe(); + } state.printPreferencesDialog = true; }, shoppingList: () => { @@ -547,6 +550,7 @@ export default defineComponent({ return { ...toRefs(state), + recipeRef, shoppingLists, selectedShoppingList, openShoppingListIngredientDialog, diff --git a/frontend/components/Domain/Recipe/RecipeDialogPrintPreferences.vue b/frontend/components/Domain/Recipe/RecipeDialogPrintPreferences.vue index eb3c5fa65e92..e54d7236b16e 100644 --- a/frontend/components/Domain/Recipe/RecipeDialogPrintPreferences.vue +++ b/frontend/components/Domain/Recipe/RecipeDialogPrintPreferences.vue @@ -48,7 +48,6 @@