소스 검색

Fix error being displayed when logging in with no ingredients

Lee Morgan 6 년 전
부모
커밋
47a10c606d
1개의 변경된 파일3개의 추가작업 그리고 3개의 파일을 삭제
  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;