Skip to content

Commit

Permalink
changePhyloTreeViaPropsComparison bug
Browse files Browse the repository at this point in the history
  • Loading branch information
jameshadfield committed Mar 5, 2018
1 parent 5962323 commit f443822
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
4 changes: 1 addition & 3 deletions src/components/tree/reactD3Interface/change.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
import { rgb } from "d3-color";
import { calcBranchStrokeCols } from "../treeHelpers";

export const changePhyloTreeViaPropsComparison = (mainTree, state, oldProps, newProps) => {
export const changePhyloTreeViaPropsComparison = (mainTree, phylotree, viewer, oldProps, newProps) => {
const args = {};
const newState = {};
/* do not use oldProps.tree or newTreeRedux */
const phylotree = mainTree ? state.tree : state.treeToo;
const viewer = mainTree ? state.Viewer : state.ViewerToo;
const oldTreeRedux = mainTree ? oldProps.tree : oldProps.treeToo;
const newTreeRedux = mainTree ? newProps.tree : newProps.treeToo;

Expand Down
4 changes: 2 additions & 2 deletions src/components/tree/tree.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,9 @@ class Tree extends React.Component {
this.Viewer.fitToViewer();
this.setState({tree});
} else {
const newState = changePhyloTreeViaPropsComparison(true, this.state, this.props, nextProps);
const newState = changePhyloTreeViaPropsComparison(true, this.state.tree, this.Viewer, this.props, nextProps);
if (this.state.treeToo) {
changePhyloTreeViaPropsComparison(false, this.state, this.props, nextProps);
changePhyloTreeViaPropsComparison(false, this.state.treeToo, this.ViewerToo, this.props, nextProps);
}
if (newState) this.setState(newState);
}
Expand Down

0 comments on commit f443822

Please sign in to comment.