Skip to content

Commit

Permalink
fix that tc_orig_lang_check_version_wordAlignment in manifest was bei…
Browse files Browse the repository at this point in the history
…ng set to unknown when repo was catalog next. (#7439)
  • Loading branch information
PhotoNomad0 authored Oct 6, 2022
1 parent e1f61af commit 5b601bd
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
5 changes: 3 additions & 2 deletions src/js/actions/MyProjects/ProjectLoadingActions.js
Original file line number Diff line number Diff line change
Expand Up @@ -506,13 +506,14 @@ function checkIfWeNeedNewerOrigLangVersion(bookId, manifest) {
if (bookId && manifest && Object.keys(manifest).length) {
const { bibleId: origLangBibleId, languageId: origLangId } = BibleHelpers.getOrigLangforBook(bookId);
const bibleFolderPath = path.join(USER_RESOURCES_PATH, origLangId, 'bibles', origLangBibleId);
const origLangOwnerForWA = manifest?.toolsSelectedOwners?.wordAlignment;
const glOwnerForWA = manifest?.toolsSelectedOwners?.wordAlignment;
const origLangOwnerForWA = getOriginalLangOwner(glOwnerForWA);
const origLangEditVersionForWA = manifest?.tc_orig_lang_check_version_wordAlignment;
console.log(`checkIfWeNeedNewerOrigLangVersion() - WA original lang: ${origLangOwnerForWA}/${origLangId}_${origLangBibleId}, version ${origLangEditVersionForWA}`);
let latestOlVersion = null;
let needNewerOrigLang = false;

if (!origLangEditVersionForWA) {
if (!origLangEditVersionForWA || (origLangEditVersionForWA === 'unknown')) {
console.log(`checkIfWeNeedNewerOrigLangVersion() - has not been edited in wA, so no need to check original language version`);
return false;
}
Expand Down
4 changes: 3 additions & 1 deletion src/js/actions/ToolActions.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import {
WORD_ALIGNMENT,
} from '../common/constants';
import { getCurrentPaneSetting } from '../helpers/SettingsHelpers';
import { getOriginalLangOwner } from '../helpers/ResourcesHelpers';
import types from './ActionTypes';
// actions
import * as ModalActions from './ModalActions';
Expand Down Expand Up @@ -71,7 +72,8 @@ export const loadTools = (toolsDir) => (dispatch) => {
export function saveResourcesUsed(toolName, gl) {
return (dispatch, getState) => {
const glOwner = getToolGlOwner(getState(), toolName) || DEFAULT_ORIG_LANG_OWNER;
const sourceBook = getSourceBook(getState(), glOwner);
const origLangOwner = getOriginalLangOwner(glOwner);
const sourceBook = getSourceBook(getState(), origLangOwner);
const sourceVersion = (sourceBook && sourceBook.manifest && sourceBook.manifest.dublin_core && sourceBook.manifest.dublin_core.version) || 'unknown';
dispatch(ProjectDetailsActions.addObjectPropertyToManifest('tc_orig_lang_check_version_' + toolName, sourceVersion));

Expand Down

0 comments on commit 5b601bd

Please sign in to comment.