Browse Source

When editing sub-ingredients, the current ingredient no longer displays as a choice.

Lee Morgan 5 năm trước cách đây
mục cha
commit
146f0185fe
1 tập tin đã thay đổi với 1 bổ sung0 xóa
  1. 1 0
      views/dashboardPage/js/modal.js

+ 1 - 0
views/dashboardPage/js/modal.js

@@ -228,6 +228,7 @@ let modal = {
 
         for(let i = 0; i < merchant.inventory.length; i++){
             let baseIngredient = merchant.inventory[i].ingredient;
+            if(baseIngredient === ingredient) continue;
             if(ingredient.subIngredients.find(j => j.ingredient.id === baseIngredient.id) === undefined){
                 let button = document.createElement("button");
                 button.innerText = baseIngredient.name;