From fb0a7475492de546598d33a5ec990f5d11856615 Mon Sep 17 00:00:00 2001 From: Kuchenpirat <24235032+Kuchenpirat@users.noreply.github.com> Date: Tue, 29 Oct 2024 16:28:53 +0100 Subject: [PATCH] fix: recipe scaler throwing error on empty serving size (#4466) --- frontend/components/Domain/Recipe/RecipeScaleEditButton.vue | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/frontend/components/Domain/Recipe/RecipeScaleEditButton.vue b/frontend/components/Domain/Recipe/RecipeScaleEditButton.vue index e7887b3f54f..b34c4932420 100644 --- a/frontend/components/Domain/Recipe/RecipeScaleEditButton.vue +++ b/frontend/components/Domain/Recipe/RecipeScaleEditButton.vue @@ -97,8 +97,8 @@ export default defineComponent({ }, }); - const numerator = ref(parseFloat(props.basicYieldNum.toFixed(3)) ?? 1); - const denominator = parseFloat(props.basicYieldNum.toFixed(32)) ?? 1; + const numerator = ref(props.basicYieldNum != null ? parseFloat(props.basicYieldNum.toFixed(3)) : 1); + const denominator = props.basicYieldNum != null ? parseFloat(props.basicYieldNum.toFixed(32)) : 1; const numberParsed = !!props.basicYieldNum; watch(() => numerator.value, () => {