Merge pull request #3 from sgmap/bug-rule-example

🐛 Une /regle avec example activé persistait
pull/6/head
Mael 2017-05-11 11:23:10 +02:00 committed by GitHub
commit 3637009550
1 changed files with 3 additions and 1 deletions

View File

@ -34,8 +34,10 @@ export default class Rule extends Component {
}
componentWillReceiveProps(nextProps){
let get = R.path(['match', 'params', 'name'])
if (get(nextProps) !== get(this.props))
if (get(nextProps) !== get(this.props)) {
this.setRule(get(nextProps))
this.setState({example: null, showValues: false})
}
}
setRule(name){
this.rule = analyseSituation(decodeRuleName(name))(this.props.situationGate)