Browse Source

Fix error being displayed when logging in with no ingredients

Lee Morgan 6 năm trước cách đây
mục cha
commit
47a10c606d
1 tập tin đã thay đổi với 3 bổ sung3 xóa
  1. 3 3
      views/dashboardPage/home.js

+ 3 - 3
views/dashboardPage/home.js

@@ -110,9 +110,9 @@ window.homeStrandObj = {
         let thisMonth = new Date(now.getFullYear(), now.getMonth(), 1);
 
         let ingredientList = merchant.ingredientsSold(merchant.transactionIndices(thisMonth));
-        window.ingredientList = [...ingredientList];
-        let iterations = (ingredientList.length < 5) ? ingredientList.length : 5;
-        if(ingredientList.length > 0){
+        if(ingredientList !== false){
+            window.ingredientList = [...ingredientList];
+            let iterations = (ingredientList.length < 5) ? ingredientList.length : 5;
             for(let i = 0; i < iterations; i++){
                 try{
                     let max = ingredientList[0].quantity;