🐛 Réparation du bouton "tout effacer"

pull/138/head
mama 2017-12-06 17:10:11 +01:00
parent 3b0d6829ad
commit 4b5c6e3b13
2 changed files with 6 additions and 5 deletions

View File

@ -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 (

View File

@ -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',