Skip to content

Commit

Permalink
Squashed commit of the following:
Browse files Browse the repository at this point in the history
commit 0550be2
Author: Boris Kovar <[email protected]>
Date:   Tue Aug 15 08:46:33 2023 +0200

    - fixed #1092
  • Loading branch information
boriskovar-m2ms committed Aug 15, 2023
1 parent fcf418d commit 86a1a7c
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 29 deletions.
2 changes: 1 addition & 1 deletion js/components/nglView/renderingObjects.js
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,7 @@ const showArrow = ({ stage, input_dict, object_name, representations, orientatio
let radius = input_dict.radius === undefined ? 0.3 : input_dict.radius;
// Handle undefined start and finish
if (input_dict.start === undefined || input_dict.end === undefined) {
const msgs = 'START OR END UNDEFINED FOR ARROW ' + input_dict.toString();
const msgs = 'START OR END UNDEFINED FOR ARROW ' + JSON.stringify(input_dict);
return Promise.reject(msgs);
}
let shape = new Shape(object_name, { disableImpostor: true });
Expand Down
58 changes: 30 additions & 28 deletions js/reducers/ngl/dispatchActions.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,36 +97,38 @@ export const loadObject = ({
};

export const deleteObject = (target, stage, deleteFromSelections) => dispatch => {
const comps = stage.getComponentsByName(target.name);
comps.list.forEach(component => stage.removeComponent(component));

if (deleteFromSelections === true && target && target.selectionType && target.moleculeId) {
const objectId = { id: target.moleculeId };
switch (target.selectionType) {
case SELECTION_TYPE.LIGAND:
dispatch(removeFromFragmentDisplayList(objectId));
break;
case SELECTION_TYPE.HIT_PROTEIN:
dispatch(removeFromProteinList(objectId));
break;
case SELECTION_TYPE.COMPLEX:
dispatch(removeFromComplexList(objectId));
break;
case SELECTION_TYPE.SURFACE:
dispatch(removeFromSurfaceList(objectId));
break;
case SELECTION_TYPE.DENSITY:
dispatch(removeFromDensityList(objectId));
dispatch(removeFromDensityListCustom(objectId, true));
dispatch(removeFromDensityListType({ id: objectId }));
break;
case SELECTION_TYPE.VECTOR:
dispatch(removeFromVectorOnList(objectId));
break;
if (stage && target) {
const comps = stage.getComponentsByName(target.name);
comps.list.forEach(component => stage.removeComponent(component));

if (deleteFromSelections === true && target && target.selectionType && target.moleculeId) {
const objectId = { id: target.moleculeId };
switch (target.selectionType) {
case SELECTION_TYPE.LIGAND:
dispatch(removeFromFragmentDisplayList(objectId));
break;
case SELECTION_TYPE.HIT_PROTEIN:
dispatch(removeFromProteinList(objectId));
break;
case SELECTION_TYPE.COMPLEX:
dispatch(removeFromComplexList(objectId));
break;
case SELECTION_TYPE.SURFACE:
dispatch(removeFromSurfaceList(objectId));
break;
case SELECTION_TYPE.DENSITY:
dispatch(removeFromDensityList(objectId));
dispatch(removeFromDensityListCustom(objectId, true));
dispatch(removeFromDensityListType({ id: objectId }));
break;
case SELECTION_TYPE.VECTOR:
dispatch(removeFromVectorOnList(objectId));
break;
}
}
}

dispatch(deleteNglObject(target));
dispatch(deleteNglObject(target));
}
};

export const checkRemoveFromDensityList = (target, objectsInView) => () => {
Expand Down

0 comments on commit 86a1a7c

Please sign in to comment.