Skip to content

Commit

Permalink
fixed issue : showing current and incoming incorrect.
Browse files Browse the repository at this point in the history
  • Loading branch information
sijumoncy committed Apr 24, 2024
1 parent 39c58c3 commit 998fbea
Showing 1 changed file with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,6 @@ function TranslationMergeUI({ conflictData, closeMergeWindow, triggerSnackBar })
const checkForConflictInSelectedBook = async (selectedBook) => {
// parse imported
const fs = window.require('fs');
console.log('..............................>>>>>>>>>>>>>>>>>>> ', usfmJsons.conflictMeta, selectedBook);
const IncomingUsfm = fs.readFileSync(path.join(usfmJsons.conflictMeta.incomingPath, selectedBook), 'utf8');
if (IncomingUsfm) {
const importedJson = await parseUsfm(IncomingUsfm);
Expand All @@ -120,7 +119,7 @@ function TranslationMergeUI({ conflictData, closeMergeWindow, triggerSnackBar })
if (currentBookUsfm) {
const currentJson = await parseUsfm(currentBookUsfm);
// generate the merge object with current , incoming , merge verses
const processOutArr = await processAndIdentiyVerseChangeinUSFMJsons(importedJson.data, currentJson.data).catch((err) => {
const processOutArr = await processAndIdentiyVerseChangeinUSFMJsons(currentJson.data, importedJson.data).catch((err) => {
console.log('process usfm : ', err);
});
const mergeJson = processOutArr[0];
Expand Down Expand Up @@ -290,16 +289,19 @@ function TranslationMergeUI({ conflictData, closeMergeWindow, triggerSnackBar })
}
};

console.log({ conflictData, conflictedChapters, resolvedBooks });
console.log({
conflictData, conflictedChapters, resolvedBooks, finishedConflict,
});

// useEffect to trigger comleted all conflict Resolution
useEffect(() => {
if (resolvedBooks.length >= Object.keys(conflictedChapters).length) {
console.log('finish check =============> ', resolvedBooks.length >= usfmJsons?.conflictMeta?.files?.length.length);
if (resolvedBooks.length >= usfmJsons?.conflictMeta?.files?.length) {
setFinishedConflict(true);
} else {
setFinishedConflict(false);
}
}, [resolvedBooks, conflictedChapters]);
}, [resolvedBooks]);

// store conflict data to usfm jsons meta
useEffect(() => {
Expand Down

0 comments on commit 998fbea

Please sign in to comment.