diff --git a/source/components/conversation/Conversation.js b/source/components/conversation/Conversation.js index ff0c3d8cb..c72aba6df 100644 --- a/source/components/conversation/Conversation.js +++ b/source/components/conversation/Conversation.js @@ -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 && (
Votre première estimation est disponible !
)} {nextSteps.length != 0 && ( diff --git a/source/reducers.js b/source/reducers.js index 3eff9f8ea..ef0cace25 100644 --- a/source/reducers.js +++ b/source/reducers.js @@ -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) {