Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
abradle committed Sep 14, 2018
1 parent cba2dd0 commit 917af25
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions js/components/moleculeView.js
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,18 @@ class MoleculeView extends GenericView {
this.setState(prevState => ({value: value_list, complexOn: complexOn, isToggleOn: thisToggleOn}))
}

componentWillReceiveProps(nextProps){
var value_list = this.state.value.slice();
if(nextProps.to_query!=this.props.data.smiles){
var index = value_list.indexOf(3);
if (index > -1) {
value_list.splice(index, 1);
this.setState(prevState => ({value: value_list}))
}
}
}


render() {
const svg_image = <SVGInline svg={this.state.img_data}/>;
const selected_style = {width: this.props.width.toString+'px',
Expand Down

0 comments on commit 917af25

Please sign in to comment.