From 37b8279ab58b831e950c6dcb2bb4bb93f1ad7c54 Mon Sep 17 00:00:00 2001 From: araemer Date: Wed, 22 Oct 2025 19:27:36 +0200 Subject: [PATCH] Fix recalculation problem with null amounts --- frontend/src/components/recipes/RecipeDetailPage.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/frontend/src/components/recipes/RecipeDetailPage.tsx b/frontend/src/components/recipes/RecipeDetailPage.tsx index b1a48a9..fb67cff 100644 --- a/frontend/src/components/recipes/RecipeDetailPage.tsx +++ b/frontend/src/components/recipes/RecipeDetailPage.tsx @@ -58,7 +58,8 @@ export default function RecipeDetailPage() { ...ingGrp, ingredientList: ingGrp.ingredientList.map((ing) => ({ ...ing, - amount: ing.amount !== undefined ? ing.amount * factor : ing.amount, + // ensure only to recalculate the amount of ingredients that actually have an amout... + amount: (ing.amount && ing.amount !== undefined) ? ing.amount * factor : undefined, })) }))