visuddhinanda 2 anni fa
parent
commit
be81d16ad3
1 ha cambiato i file con 4 aggiunte e 4 eliminazioni
  1. 4 4
      dashboard/src/components/template/SentEdit/SentCell.tsx

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

@@ -132,13 +132,13 @@ const SentCellWidget = ({
 
     const found = acceptPr
       .filter((value) => typeof value !== "undefined")
-      .findIndex((value) => {
+      .find((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]);
+    if (typeof found !== "undefined") {
+      console.debug("sent cell sentence apply", uuid, found, found);
+      setSentData(found);
       store.dispatch(done(uuid));
     }
   }, [acceptPr, sentData, isPr, uuid, changedSent, sid]);