Explorar o código

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

Lee Morgan %!s(int64=5) %!d(string=hai) anos
pai
achega
672eac50e7
Modificáronse 1 ficheiros con 1 adicións e 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;