Explorar el Código

Analytics categories display correct data, but only on page reload.

Lee Morgan hace 5 años
padre
commit
672eac50e7
Se han modificado 1 ficheros con 1 adiciones y 1 borrados
  1. 1 1
      views/dashboardPage/js/classes/Transaction.js

+ 1 - 1
views/dashboardPage/js/classes/Transaction.js

@@ -46,7 +46,7 @@ class Transaction{
     getIngredientQuantity(ingredient){
         let total = 0;
         for(let i = 0; i < this._recipes.length; i++){
-            total += this._recipes[i].recipe.getIngredientTotal(ingredient.id);
+            total += this._recipes[i].recipe.getIngredientTotal(ingredient.id) * this._recipes[i].quantity;
         }
 
         return total;