diff --git a/js/components/preview/compounds/redux/actions.js b/js/components/preview/compounds/redux/actions.js index e46565b42..b5834ecdd 100644 --- a/js/components/preview/compounds/redux/actions.js +++ b/js/components/preview/compounds/redux/actions.js @@ -60,6 +60,6 @@ export const removeSelectedCompoundClass = compoundID => ({ payload: compoundID }); -export const resetSelectedCompoundClass = () => ({ - type: constants.RESET_SELECTED_COMPOUND_CLASS +export const resetCompoundsToPick = () => ({ + type: constants.RESET_COMPOUNDS_TO_PICK }); diff --git a/js/components/preview/compounds/redux/constants.js b/js/components/preview/compounds/redux/constants.js index f26eaa9c8..0c62dc983 100644 --- a/js/components/preview/compounds/redux/constants.js +++ b/js/components/preview/compounds/redux/constants.js @@ -14,7 +14,7 @@ export const constants = { APPEND_SELECTED_COMPOUND_CLASS: prefix + 'APPEND_SELECTED_COMPOUND_CLASS', REMOVE_SELECTED_COMPOUND_CLASS: prefix + 'REMOVE_SELECTED_COMPOUND_CLASS', - RESET_SELECTED_COMPOUND_CLASS: prefix + 'RESET_SELECTED_COMPOUND_CLASS' + RESET_COMPOUNDS_TO_PICK: prefix + 'RESET_COMPOUNDS_TO_PICK' }; const colors = { diff --git a/js/components/preview/compounds/redux/dispatchActions.js b/js/components/preview/compounds/redux/dispatchActions.js index c0432bb37..151c93e73 100644 --- a/js/components/preview/compounds/redux/dispatchActions.js +++ b/js/components/preview/compounds/redux/dispatchActions.js @@ -8,7 +8,7 @@ import { removeShowedCompoundFromList, removeSelectedCompoundClass, addSelectedCompoundClass, - resetSelectedCompoundClass + resetCompoundsToPick } from './actions'; import { deleteObject, loadObject } from '../../../../reducers/ngl/dispatchActions'; import { VIEWS } from '../../../../constants/constants'; @@ -43,7 +43,7 @@ export const selectAllCompounds = () => (dispatch, getState) => { export const clearAllSelectedCompounds = () => dispatch => { dispatch(setToBuyList([])); - dispatch(resetSelectedCompoundClass()); + dispatch(resetCompoundsToPick()); }; export const onChangeCompoundClassValue = event => (dispatch, getState) => { diff --git a/js/components/preview/compounds/redux/reducer.js b/js/components/preview/compounds/redux/reducer.js index acb22e8f8..1da5515db 100644 --- a/js/components/preview/compounds/redux/reducer.js +++ b/js/components/preview/compounds/redux/reducer.js @@ -114,8 +114,8 @@ export const compounds = (state = INITIAL_STATE, action = {}) => { selectedCompoundsClass: diminishedSelectedCmpdClass }); - case constants.RESET_SELECTED_COMPOUND_CLASS: - return Object.assign({}, state, { selectedCompoundsClass: defaultSelectedCmpdsClass }); + case constants.RESET_COMPOUNDS_TO_PICK: + return Object.assign({}, INITIAL_STATE); default: return state;