From 2c41923d4766bbca65548eca93b046f52abed2a9 Mon Sep 17 00:00:00 2001 From: Michael Genson <71845777+michael-genson@users.noreply.github.com> Date: Thu, 23 Jul 2026 07:58:31 -0500 Subject: [PATCH] fix: Replace shadowed `ref` var name when adding recipe to shopping list (#7937) --- .../Domain/Recipe/RecipeDialogAddToShoppingList.vue | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/frontend/app/components/Domain/Recipe/RecipeDialogAddToShoppingList.vue b/frontend/app/components/Domain/Recipe/RecipeDialogAddToShoppingList.vue index f315c4ce3..6345a0611 100644 --- a/frontend/app/components/Domain/Recipe/RecipeDialogAddToShoppingList.vue +++ b/frontend/app/components/Domain/Recipe/RecipeDialogAddToShoppingList.vue @@ -308,12 +308,12 @@ async function consolidateRecipesIntoSections(recipes: RecipeWithScale[]) { const recipeSectionMap = new Map(); function addSubRecipeToMap(ing: RecipeIngredient, parentQuantity: number, parentScale: number, parentRecipe: Recipe) { - const ref = ing.referencedRecipe!; - const key = ref.id || ref.slug || ""; + const subRecipe = ing.referencedRecipe!; + const key = subRecipe.id || subRecipe.slug || ""; const ownIngs: ShoppingListIngredient[] = []; const subRefIngs: RecipeIngredient[] = []; - for (const subIng of ref.recipeIngredient ?? []) { + for (const subIng of subRecipe.recipeIngredient ?? []) { if (subIng.referencedRecipe) { subRefIngs.push(subIng); } @@ -327,14 +327,14 @@ async function consolidateRecipesIntoSections(recipes: RecipeWithScale[]) { } recipeSectionMap.set(key, { - recipeId: ref.id || "", - recipeName: ref.name || "", + recipeId: subRecipe.id || "", + recipeName: subRecipe.name || "", recipeScale: parentQuantity * parentScale, ingredientSections: buildIngredientSections(ownIngs), parentRecipe, }); - subRefIngs.forEach(subIng => addSubRecipeToMap(subIng, (ing.quantity || 1) * (subIng.quantity || 1), parentScale, ref)); + subRefIngs.forEach(subIng => addSubRecipeToMap(subIng, (ing.quantity || 1) * (subIng.quantity || 1), parentScale, subRecipe)); } for (const recipe of recipes) {