Fix recalculation problem with null amounts
This commit is contained in:
parent
0dc2eb2e3c
commit
37b8279ab5
1 changed files with 2 additions and 1 deletions
|
|
@ -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,
|
||||
}))
|
||||
}))
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue