Skip to content

Commit

Permalink
fixes zero-out variables bug
Browse files Browse the repository at this point in the history
  • Loading branch information
jhmullen authored and davelandry committed Mar 13, 2019
1 parent 009d061 commit b04b6fb
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion app/cms/profile/ProfileBuilder.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,14 @@ class ProfileBuilder extends Component {
}
if (this.props.setPath) this.props.setPath(node);
const currentSlug = node.masterSlug;
this.setState({currentNode: node, currentSlug, preview: ""});
// if we are changing slugs, zero out the preview to avoid a nasty re-render
if (this.state.currentSlug !== node.masterSlug) {
this.setState({currentNode: node, currentSlug, preview: ""});
}
// otherwise leave the preview alone
else {
this.setState({currentNode: node, currentSlug});
}
}

handleNodeCollapse(node) {
Expand Down

0 comments on commit b04b6fb

Please sign in to comment.