From dd56bb4b35dfd70e1c36b9f44f8aa225aacad968 Mon Sep 17 00:00:00 2001 From: vabene1111 Date: Wed, 19 Nov 2025 20:17:39 +0100 Subject: [PATCH] fixed property detail dialog serving scaling --- vue3/src/components/display/PropertyView.vue | 19 +++++++++++-------- vue3/src/components/display/RecipeView.vue | 2 +- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/vue3/src/components/display/PropertyView.vue b/vue3/src/components/display/PropertyView.vue index 97b2f6c54..eb0c0d7ed 100644 --- a/vue3/src/components/display/PropertyView.vue +++ b/vue3/src/components/display/PropertyView.vue @@ -37,15 +37,15 @@ - @@ -59,7 +59,7 @@ - {{ $n(fv.value) }} {{ dialogProperty.unit }} + {{ $n(fv.value * props.ingredientFactor) }} {{ dialogProperty.unit }} {{ $t('NoUnit') }} @@ -101,7 +101,10 @@ type PropertyWrapper = { } const props = defineProps({ - servings: {type: Number, required: true,}, + ingredientFactor: { + type: Number, + required: true, + }, }) const recipe = defineModel({required: true}) @@ -143,7 +146,7 @@ const propertyList = computed(() => { description: rp.propertyType.description, foodValues: [], propertyAmountPerServing: rp.propertyAmount, - propertyAmountTotal: rp.propertyAmount * recipe.value.servings * (props.servings / recipe.value.servings), + propertyAmountTotal: rp.propertyAmount * recipe.value.servings * props.ingredientFactor, missingValue: false, unit: rp.propertyType.unit, type: rp.propertyType, @@ -161,7 +164,7 @@ const propertyList = computed(() => { icon: fp.icon, foodValues: fp.food_values, propertyAmountPerServing: fp.total_value / recipe.value.servings, - propertyAmountTotal: fp.total_value * (props.servings / recipe.value.servings), + propertyAmountTotal: fp.total_value * props.ingredientFactor, missingValue: fp.missing_value, unit: fp.unit, type: fp, diff --git a/vue3/src/components/display/RecipeView.vue b/vue3/src/components/display/RecipeView.vue index ee31b0847..7fa2e4607 100644 --- a/vue3/src/components/display/RecipeView.vue +++ b/vue3/src/components/display/RecipeView.vue @@ -144,7 +144,7 @@ - +