diff --git a/source/reducers/reducers.js b/source/reducers/reducers.js index e5af3affa..609e3861a 100644 --- a/source/reducers/reducers.js +++ b/source/reducers/reducers.js @@ -67,11 +67,16 @@ function conversationSteps( if (type !== 'STEP_ACTION') return state if (name === 'fold') return { foldedSteps: [...state.foldedSteps, step] } - if (name === 'unfold') + if (name === 'unfold') { + // if a step had already been unfolded, bring it back ! return { - foldedSteps: without([step], state.foldedSteps), + foldedSteps: [ + ...without([step], state.foldedSteps), + ...(state.unfoldedStep ? [state.unfoldedStep] : []) + ], unfoldedStep: step } + } } export default reduceReducers(