Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
import sourceContentUpdater from 'tc-source-content-updater';
import {
getTranslate, getContext, getSelectedToolName, getProjectSaveLocation, getProjectBookId,
} from '../selectors';
// helpers
import { getLocalResourceList } from '../helpers/sourceContentUpdatesHelpers';
import { copyGroupDataToProject, updateSourceContentUpdaterManifest } from '../helpers/ResourcesHelpers';
import { getOrigLangforBook } from '../helpers/bibleHelpers';
import * as Bible from '../common/BooksOfTheBible';
import { loadBookTranslations } from './ResourcesActions';
import {
openAlertDialog, closeAlertDialog, openOptionDialog,
} from './AlertModalActions';
import consts from './ActionTypes';
// constants
const SourceContentUpdater = new sourceContentUpdater();
const USER_RESOURCES_PATH = path.join(ospath.home(), 'translationCore/resources');
/**
* Resets the state of the source content updates reducer.
*/
export const resetSourceContentUpdatesReducer = () => ({ type: consts.RESET_LIST_OF_SOURCE_CONTENT_TO_UPDATE });
export const updateSourceContentUpdatesReducer = () => ({ type: consts.SOURCE_CONTENT_UPDATED });
const failedAlertAndRetry = (closeSourceContentDialog, retryCallback, failAlertMessage) => ((dispatch, getState) => {
const translate = getTranslate(getState());
dispatch(
openOptionDialog(
translate(failAlertMessage),
() => dispatch(retryCallback()),