Skip to content

Commit

Permalink
xchem#41 fix indexes of compounds
Browse files Browse the repository at this point in the history
  • Loading branch information
tibor-postek-m2ms committed Mar 10, 2020
1 parent 683aa39 commit 2e0eb03
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions js/components/preview/compounds/redux/actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
});
2 changes: 1 addition & 1 deletion js/components/preview/compounds/redux/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down
4 changes: 2 additions & 2 deletions js/components/preview/compounds/redux/dispatchActions.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
removeShowedCompoundFromList,
removeSelectedCompoundClass,
addSelectedCompoundClass,
resetSelectedCompoundClass
resetCompoundsToPick
} from './actions';
import { deleteObject, loadObject } from '../../../../reducers/ngl/dispatchActions';
import { VIEWS } from '../../../../constants/constants';
Expand Down Expand Up @@ -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) => {
Expand Down
4 changes: 2 additions & 2 deletions js/components/preview/compounds/redux/reducer.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 2e0eb03

Please sign in to comment.