visuddhinanda 2 лет назад
Родитель
Сommit
9e7ebd9982
1 измененных файлов с 6 добавлено и 4 удалено
  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]);