Ne pas afficher la solution à un contrôle si elle est résolue

pull/385/head
Mael 2018-09-13 15:55:55 +02:00
parent 64387d3da6
commit f31eeb0b03
1 changed files with 15 additions and 12 deletions

View File

@ -13,7 +13,8 @@ function Controls({
blockingInputControls,
controls,
startConversation,
currentQuestion
currentQuestion,
foldedSteps
}) {
let control =
!blockingInputControls &&
@ -55,17 +56,18 @@ function Controls({
{!message && (
<div id="controlExplanation">{makeJsx(evaluated)}</div>
)}
{solution && (
<div id="solution">
{emoji('💡')}
<button
key={solution.cible}
className="ui__ link-button"
onClick={() => startConversation(solution.cible)}>
{solution.texte}
</button>
</div>
)}
{solution &&
!foldedSteps.includes(solution.cible) && (
<div id="solution">
{emoji('💡')}
<button
key={solution.cible}
className="ui__ link-button"
onClick={() => startConversation(solution.cible)}>
{solution.texte}
</button>
</div>
)}
</>
}}
</div>
@ -80,6 +82,7 @@ function Controls({
export default connect(
(state, props) => ({
currentQuestion: currentQuestionSelector(state),
foldedSteps: state.conversationSteps.foldedSteps,
key: props.language
}),
{