From 9af3c3a2c745bc288972422f4ea0223628d4c520 Mon Sep 17 00:00:00 2001 From: sagarika-padmanaban Date: Thu, 12 Dec 2024 17:09:58 +0530 Subject: [PATCH] fix --- src/common/CompareEdits.jsx | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/common/CompareEdits.jsx b/src/common/CompareEdits.jsx index 72ac13fd..0a6ac710 100644 --- a/src/common/CompareEdits.jsx +++ b/src/common/CompareEdits.jsx @@ -64,13 +64,13 @@ const CompareEdits = ({ const fetchPreviewData = useCallback(async () => { setLoading(true) + console.log(targetLanguage); + if(taskType=="TRANSCRIPTION_EDIT"){ - console.log("hhh"); var taskObj = new Compare(videoId); }else{ - console.log("hhh"); var taskObj = new Comparetrans(videoId); } @@ -108,16 +108,16 @@ const CompareEdits = ({ if (data) { const editComplete = []; const selectSource = []; - console.log(data); data.forEach((translate) => { - if (translate.status === "TRANSLATION_EDIT_COMPLETE") { + + if (translate.status === "TRANSLATION_EDIT_COMPLETE" && targetLanguage == translate.target_language) { editComplete.push( ...translate.data.payload.map((item) => item.target_text) ); - } else if (translate.status === "TRANSLATION_SELECT_SOURCE") { + } else if (translate.status === "TRANSLATION_SELECT_SOURCE" && targetLanguage== translate.target_language) { selectSource.push( - ...translate.data.payload.map((item) => item.target_text) + ...translate.data.payload.map((item) => item.target_text ) ); } });