Skip to content

Commit

Permalink
#429 Restore current state as a result of the actions applied on the …
Browse files Browse the repository at this point in the history
…default state
  • Loading branch information
Adriána Kohanová committed Nov 6, 2020
1 parent 3a9db85 commit 080a738
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions js/reducers/tracking/dispatchActions.js
Original file line number Diff line number Diff line change
Expand Up @@ -361,14 +361,12 @@ const restoreCompoundsActions = (orderedActionList, stage) => (dispatch, getStat
dispatch(addNewTypeCompound(compoundsAction, actionType.SURFACE_TURNED_ON, 'surface', stage, state));
}

let compoundsSelectedAction = compoundsAction.filter(
action => action.action_type === actionObjectType.COMPOUND_SELECTED
);
let compoundsSelectedAction = compoundsAction.filter(action => action.action_type === actionType.COMPOUND_SELECTED);

compoundsSelectedAction.forEach(action => {
let data = getCompound(action.object_name, state);
if (data) {
dispatch(appendMoleculeToCompoundsOfDatasetToBuy(data.datasetID, data.id, data.name));
dispatch(appendMoleculeToCompoundsOfDatasetToBuy(action.dataset_id, data.id, data.name));
}
});
};
Expand All @@ -394,7 +392,7 @@ const addNewType = (moleculesAction, actionType, type, stage, state) => dispatch
actions.forEach(action => {
let data = getMolecule(action.object_name, state);
if (data) {
dispatch(addType[type](stage, data, colourList[data.id % colourList.length]));
dispatch(addType[type](stage, data, colourList[data.id % colourList.length], true));
}
});
}
Expand Down

0 comments on commit 080a738

Please sign in to comment.