🐛 Admettre qu'on ne peut pas calculer les 'une possibilité'

pull/74/head
Laurent Bossavit 2017-10-02 17:08:14 +02:00
parent 8191379e9f
commit 65a78418ec
1 changed files with 3 additions and 2 deletions

View File

@ -18,7 +18,8 @@ export default class Algorithm extends React.Component {
showValues: true
}
render(){
let {traversedRule: rule, showValues} = this.props
let {traversedRule: rule, showValues} = this.props,
ruleWithoutFormula = !rule['formule'] || rule.formule.explanation['une possibilité']
return (
<div id="algorithm">
<section id="rule-rules" className={classNames({showValues})}>
@ -34,7 +35,7 @@ export default class Algorithm extends React.Component {
}}
<section id="formule">
<h2>Calcul</h2>
{rule['formule'] ? makeJsx(rule['formule']) : <RuleWithoutFormula />}
{ruleWithoutFormula ? <RuleWithoutFormula /> : makeJsx(rule['formule'])}
</section>
</section>
</div>