Răsfoiți Sursa

过滤 acceptPr=undefined

visuddhinanda 2 ani în urmă
părinte
comite
9e7ebd9982
1 a modificat fișierele cu 6 adăugiri și 4 ștergeri
  1. 6 4
      dashboard/src/components/template/SentEdit/SentCell.tsx

+ 6 - 4
dashboard/src/components/template/SentEdit/SentCell.tsx

@@ -130,10 +130,12 @@ const SentCellWidget = ({
       return;
     }
 
-    const found = acceptPr.findIndex((value) => {
-      const vId = `${value.book}_${value.para}_${value.wordStart}_${value.wordEnd}_${value.channel.id}`;
-      return vId === sid;
-    });
+    const found = acceptPr
+      .filter((value) => typeof value !== "undefined")
+      .findIndex((value) => {
+        const vId = `${value.book}_${value.para}_${value.wordStart}_${value.wordEnd}_${value.channel.id}`;
+        return vId === sid;
+      });
     if (found !== -1) {
       console.debug("sent cell sentence apply", uuid, found, acceptPr[found]);
       setSentData(acceptPr[found]);