Procházet zdrojové kódy

Fix bug in the displaying of bottles as recipe ingredients

Lee Morgan před 5 roky
rodič
revize
f7d2d42235

+ 4 - 11
views/dashboardPage/bundle.js

@@ -177,10 +177,6 @@ class MerchantIngredient{
     }
 
     convertToBase(quantity){
-        if(this._ingredient.specialUnit === "bottle"){
-            return quantity;
-        }
-
         switch(this._ingredient.unit){
             case "g": return quantity;
             case "kg": return quantity * 1000; 
@@ -952,9 +948,9 @@ class RecipeIngredient{
     }
 
     get quantity(){
-        if(this._ingredient.specialUnit === "bottle"){
-            return this._quantity / this._ingredient.unitSize;
-        }
+        // if(this._ingredient.specialUnit === "bottle"){
+        //     return this._quantity / this._ingredient.unitSize;
+        // }
 
         switch(this._ingredient.unit){
             case "g":return this._quantity;
@@ -990,6 +986,7 @@ class RecipeIngredient{
 
     getQuantityDisplay(){
         if(this._ingredient.specialUnit === "bottle"){
+            
             return `${this.quantity.toFixed(2)} BOTTLES`;
         }
 
@@ -997,10 +994,6 @@ class RecipeIngredient{
     }
 
     convertToBase(quantity){
-        if(this._ingredient.specialUnit === "bottle"){
-            return quantity;
-        }
-
         switch(this._ingredient.unit){
             case "g": return quantity;
             case "kg": return quantity * 1000; 

+ 0 - 4
views/dashboardPage/js/Merchant.js

@@ -50,10 +50,6 @@ class MerchantIngredient{
     }
 
     convertToBase(quantity){
-        if(this._ingredient.specialUnit === "bottle"){
-            return quantity;
-        }
-
         switch(this._ingredient.unit){
             case "g": return quantity;
             case "kg": return quantity * 1000; 

+ 4 - 7
views/dashboardPage/js/Recipe.js

@@ -13,9 +13,9 @@ class RecipeIngredient{
     }
 
     get quantity(){
-        if(this._ingredient.specialUnit === "bottle"){
-            return this._quantity / this._ingredient.unitSize;
-        }
+        // if(this._ingredient.specialUnit === "bottle"){
+        //     return this._quantity / this._ingredient.unitSize;
+        // }
 
         switch(this._ingredient.unit){
             case "g":return this._quantity;
@@ -51,6 +51,7 @@ class RecipeIngredient{
 
     getQuantityDisplay(){
         if(this._ingredient.specialUnit === "bottle"){
+            
             return `${this.quantity.toFixed(2)} BOTTLES`;
         }
 
@@ -58,10 +59,6 @@ class RecipeIngredient{
     }
 
     convertToBase(quantity){
-        if(this._ingredient.specialUnit === "bottle"){
-            return quantity;
-        }
-
         switch(this._ingredient.unit){
             case "g": return quantity;
             case "kg": return quantity * 1000;