🐛 Corrige le retour des extraSteps lors du double unfold

pull/110/head
Laurent Bossavit 2017-11-05 15:01:47 +01:00
parent 3337c91df6
commit 4a5b134074
1 changed files with 3 additions and 2 deletions

View File

@ -99,8 +99,9 @@ export let reduceSteps = (tracker, flatRules, answerSource) => (state, action) =
let previous = state.currentQuestion,
answered = previous && (answerSource(state)(previous) != undefined),
foldable = answered ? [previous] : [],
foldedSteps = R.without([action.step])(R.concat(state.foldedSteps, foldable)),
extraSteps = R.without([action.step], state.extraSteps)
foldedSteps = R.without([action.step], R.concat(state.foldedSteps, foldable)),
fromExtra = !answered && R.contains(previous, R.keys(softAssumptions)),
extraSteps = R.without([action.step], fromExtra ? R.concat(state.extraSteps, [previous]) : state.extraSteps)
return {
...newState,