From 42f579fc8aeb27a8b4d393485e9d3a6dce6bd50e Mon Sep 17 00:00:00 2001 From: mama Date: Thu, 23 Nov 2017 11:25:24 +0100 Subject: [PATCH] =?UTF-8?q?Optimisation=20:=20deuxi=C3=A8me=20toLowerCase?= =?UTF-8?q?=20mal=20plac=C3=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- source/components/conversation/Explicable.js | 9 ++++++--- source/components/conversation/Question.js | 2 +- source/engine/rules.js | 6 ++++-- 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/source/components/conversation/Explicable.js b/source/components/conversation/Explicable.js index 4a84784a1..461cf3a41 100644 --- a/source/components/conversation/Explicable.js +++ b/source/components/conversation/Explicable.js @@ -18,11 +18,14 @@ export default class Explicable extends React.Component { dottedName, hover, label, explain, explained, lightBackground - } = this.props, - rule = findRuleByDottedName(rules, dottedName) + } = this.props // Rien à expliquer ici, ce n'est pas une règle - if (!rule) return {label} + if (dottedName == null) + return {label} + + let rule = findRuleByDottedName(rules, dottedName) + let ruleLabel = ( label || rule.title diff --git a/source/components/conversation/Question.js b/source/components/conversation/Question.js index 0460c8ac9..6a39a1b61 100644 --- a/source/components/conversation/Question.js +++ b/source/components/conversation/Question.js @@ -75,7 +75,7 @@ export default class Question extends Component { return (