From 3c708d4f778728b313209d25b10bca73f95e5696 Mon Sep 17 00:00:00 2001 From: June Date: Mon, 17 Nov 2025 16:36:28 +1300 Subject: [PATCH] fix crash when no quantity is given --- web/src/components/detail/IngredientTableView.astro | 2 +- web/src/components/detail/StepIngredientSideView.astro | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/web/src/components/detail/IngredientTableView.astro b/web/src/components/detail/IngredientTableView.astro index de3b63d..a9f4749 100644 --- a/web/src/components/detail/IngredientTableView.astro +++ b/web/src/components/detail/IngredientTableView.astro @@ -32,7 +32,7 @@ const tableView = true ingredients.map((ing, index) => ( <> - {ing.quantity.value.value} + {ing.quantity ? ing.quantity.value.value : ''} {ing.unit || ''} {ing.name}{ing.preparation ? ` (${ing.preparation})` : ''} diff --git a/web/src/components/detail/StepIngredientSideView.astro b/web/src/components/detail/StepIngredientSideView.astro index 1f5c1d8..9559954 100644 --- a/web/src/components/detail/StepIngredientSideView.astro +++ b/web/src/components/detail/StepIngredientSideView.astro @@ -5,6 +5,6 @@ const { ingredients, class: className } = Astro.props;
{ingredients.map(i => ( +
  • {i.quantity ? i.quantity.value.value : ''} {i.unit || ""} {i.name} {i.preparation ? `(${i.preparation})` : ''}
  • ))}
    \ No newline at end of file