From 1c25f2dbb74e624f5f284ebf39ad8f9139a070f5 Mon Sep 17 00:00:00 2001 From: Kurt Riddlesperger Date: Sat, 25 Jan 2020 22:18:40 -0600 Subject: [PATCH] disable weekRecipeConsume if weekCosts are zero --- public/viewjs/mealplan.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/public/viewjs/mealplan.js b/public/viewjs/mealplan.js index ad69ccba..679c47d1 100644 --- a/public/viewjs/mealplan.js +++ b/public/viewjs/mealplan.js @@ -64,7 +64,8 @@ var calendar = $("#calendar").fullCalendar({ weekRecipeOrderMissingButtonDisabledClasses = "disabled"; } var weekRecipeConsumeButtonDisabledClasses = ""; - if (FindObjectInArrayByPropertyValue(recipesResolved, "recipe_id", weekRecipe.id).need_fulfilled == 0) + console.log(weekCosts); + if (FindObjectInArrayByPropertyValue(recipesResolved, "recipe_id", weekRecipe.id).need_fulfilled == 0 || weekCosts == 0) { weekRecipeConsumeButtonDisabledClasses = "disabled"; }