Fix recalculation problem with null amounts

This commit is contained in:
araemer 2025-10-22 19:27:36 +02:00
parent 0dc2eb2e3c
commit 37b8279ab5

View file

@ -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,
}))
}))