Le message "1ère estimation dispo" n'apparaît qu'une fois

pull/138/head
mama 2017-11-28 11:16:54 +01:00
parent c773a998b5
commit 53383b33ca
2 changed files with 9 additions and 2 deletions

View File

@ -10,6 +10,13 @@ import Scroll from 'react-scroll'
destroyOnUnmount: false
})
export default class Conversation extends Component {
state = {
nbFoldedStepsForFirstEstimation: null
}
componentWillReceiveProps(newProps) {
if (newProps.done && this.state.nbFoldedStepsForFirstEstimation == null)
this.setState({nbFoldedStepsForFirstEstimation: newProps.foldedSteps.length})
}
render() {
let {
foldedSteps,
@ -44,7 +51,7 @@ export default class Conversation extends Component {
)}
{done && (
<div className="tip">
{nextSteps.length != 0 && (
{nextSteps.length != 0 && this.state.nbFoldedStepsForFirstEstimation === foldedSteps.length && (
<p>Votre première estimation est disponible !</p>
)}
{nextSteps.length != 0 && (

View File

@ -79,7 +79,7 @@ export let reduceSteps = (tracker, flatRules, answerSource) => (
// The simulation is "over" - except we can now fill in extra questions
// where the answers were previously given default reasonable assumptions
nextWithoutDefaults(state, flatRules, analysis, targetNames, intermediateSituation)
: {currentQuestion: head(nextWithDefaults), nextSteps: nextWithDefaults})
: {currentQuestion: head(nextWithDefaults), nextSteps: nextWithDefaults, })
}
if (action.type == START_CONVERSATION) {