From b921e951635dd1c0872fe3c7061b26de0271634a Mon Sep 17 00:00:00 2001 From: Hayden <64056131+hay-kot@users.noreply.github.com> Date: Sat, 25 Jun 2022 12:19:04 -0800 Subject: [PATCH] fix: entry nutrition checker (#1448) --- .../components/Domain/Recipe/RecipeNutrition.vue | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/frontend/components/Domain/Recipe/RecipeNutrition.vue b/frontend/components/Domain/Recipe/RecipeNutrition.vue index 116e283d0551..7c45f1138262 100644 --- a/frontend/components/Domain/Recipe/RecipeNutrition.vue +++ b/frontend/components/Domain/Recipe/RecipeNutrition.vue @@ -81,9 +81,12 @@ export default defineComponent({ }, }; const valueNotNull = computed(() => { - Object.values(props.value).forEach((valueProperty) => { - if (valueProperty && valueProperty !== "") return true; - }); + let key: keyof Nutrition; + for (key in props.value) { + if (props.value[key] !== null) { + return true; + } + } return false; }); @@ -97,8 +100,8 @@ export default defineComponent({ labels, valueNotNull, showViewer, - updateValue - } + updateValue, + }; }, });