Browse Source

Update catchData.ts

lex 1 năm trước cách đây
mục cha
commit
ee1d83cc39
1 tập tin đã thay đổi với 11 bổ sung12 xóa
  1. 11 12
      src/store/modules/catchData.ts

+ 11 - 12
src/store/modules/catchData.ts

@@ -52,21 +52,20 @@ export const useCatchStore = defineStore('catch-store', {
     getEnableSubjects(): any[] {
       const temp: any[] = [];
       this.subjectList.forEach((subject: any) => {
-        // if (subject.enableFlag) {
-        const { instruments, ...r } = subject;
+        if (subject.enableFlag) {
+          const { instruments, ...r } = subject;
 
-        if (instruments && instruments.length > 0) {
-          const tempChild: any[] = [];
-          instruments?.forEach((instrument: any) => {
-            if (instrument.enableFlag) {
-              tempChild.push(instrument);
-            }
-          });
+          if (instruments && instruments.length > 0) {
+            const tempChild: any[] = [];
+            instruments?.forEach((instrument: any) => {
+              if (instrument.enableFlag) {
+                tempChild.push(instrument);
+              }
+            });
 
-          temp.push({ ...r, instruments: tempChild });
+            temp.push({ ...r, instruments: tempChild });
+          }
         }
-
-        // }
       });
       return temp;
     },