Skip to content

Commit

Permalink
xchem#41 fix uncheck 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 f7e02d3 commit 33fe961
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions js/components/preview/compounds/redux/dispatchActions.js
Original file line number Diff line number Diff line change
Expand Up @@ -132,22 +132,22 @@ export const handleClickOnCompound = ({ data, event, majorViewStage }) => async
for (const classKey of Object.keys(selectedCompoundsClass)) {
const currentCmpdClassId = selectedCompoundsClass[classKey].find(item => item === data.index);
console.log(selectedCompoundsClass[classKey], currentCmpdClassId);
console.err(selectedCompoundsClass[classKey], currentCmpdClassId);
//console.err(selectedCompoundsClass[classKey], currentCmpdClassId);
if (currentCmpdClassId !== undefined) {
isSelectedID = currentCmpdClassId;
break;
}
}
console.log(isSelectedID, ' current ID');
console.err(isSelectedID, ' current ID');
// console.err(isSelectedID, ' current ID');
if (isSelectedID !== undefined) {
console.log(isSelectedID, 'removing compound class');
console.err(isSelectedID, 'removing compound class');
// console.err(isSelectedID, 'removing compound class');
await dispatch(removeSelectedCompoundClass(data.index));
dispatch(removeFromToBuyList(data));
} else {
console.log(isSelectedID, 'add compound class');
console.err(isSelectedID, 'add compound class');
// console.err(isSelectedID, 'add compound class');
await dispatch(addSelectedCompoundClass(currentCompoundClass, data.index));
dispatch(appendToBuyList(data));
}
Expand Down

0 comments on commit 33fe961

Please sign in to comment.