From 4b5c6e3b13fbc81b60b7fca8b05db8a292edee08 Mon Sep 17 00:00:00 2001 From: mama Date: Wed, 6 Dec 2017 17:10:11 +0100 Subject: [PATCH] =?UTF-8?q?:bug:=20R=C3=A9paration=20du=20bouton=20"tout?= =?UTF-8?q?=20effacer"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- source/components/Simulateur.js | 8 ++++---- source/reducers.js | 3 ++- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/source/components/Simulateur.js b/source/components/Simulateur.js index dcfc48b4e..3485a1cfa 100644 --- a/source/components/Simulateur.js +++ b/source/components/Simulateur.js @@ -30,8 +30,8 @@ import ResultsGrid from 'Components/ResultsGrid' inputInversions: formValueSelector('conversation')(state, 'inversions') }), dispatch => ({ - startConversation: targetNames => - dispatch({ type: START_CONVERSATION, targetNames }), + startConversation: (targetNames, fromScratch=false) => + dispatch({ type: START_CONVERSATION, targetNames, fromScratch }), resetForm: () => dispatch(reset('conversation')), resetFormField: name => dispatch(change('conversation', name, '')) }) @@ -75,8 +75,8 @@ export default class extends Component { } = this.props, reinitalise = () => { ReactPiwik.push(['trackEvent', 'restart', '']) - this.props.resetForm(this.name) - this.props.startConversation(this.targets) + this.props.resetForm() + this.props.startConversation(this.targetNames, true) } return ( diff --git a/source/reducers.js b/source/reducers.js index ed343aceb..339a36ae0 100644 --- a/source/reducers.js +++ b/source/reducers.js @@ -88,11 +88,12 @@ export let reduceSteps = (tracker, flatRules, answerSource) => ( return { ...newState, // when objectives change, reject theme from answered questions - foldedSteps: R.reject(name => targetNames.includes(nameLeaf(name)))( + foldedSteps: action.fromScratch ? [] : R.reject(name => targetNames.includes(nameLeaf(name)))( state.foldedSteps ) } } + if (action.type == STEP_ACTION && action.name == 'fold') { tracker.push([ 'trackEvent',