Skip to content

Commit

Permalink
Merge pull request #855 from AI4Bharat/compare-edits
Browse files Browse the repository at this point in the history
Compare edits
  • Loading branch information
aparna-aa authored Dec 12, 2024
2 parents 6982324 + 06fb221 commit b634730
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/common/CompareEdits.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down Expand Up @@ -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 )
);
}
});
Expand Down

0 comments on commit b634730

Please sign in to comment.