Skip to content

Commit

Permalink
xchem#144 simplify reset compound classes
Browse files Browse the repository at this point in the history
  • Loading branch information
tibor-postek-m2ms committed Mar 10, 2020
1 parent f56a8ab commit ac5a65f
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions js/components/preview/compounds/redux/reducer.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,7 @@ export const compounds = (state = INITIAL_STATE, action = {}) => {
});

case constants.RESET_COMPOUND_CLASSES:
const currentState = JSON.parse(JSON.stringify(state));
delete currentState.compoundClasses;
currentState.compoundClasses = {};
return Object.assign({}, currentState);
return Object.assign({}, state, { compoundClasses: {} });

case constants.SET_HIGHLIGHTED_COMPOUND_ID:
return Object.assign({}, state, { highlightedCompoundId: action.payload });
Expand Down

0 comments on commit ac5a65f

Please sign in to comment.