🐛 On peut mofier une question 2 fois, la 1ere est revalidee

pull/256/head
Mael 2018-06-13 17:01:45 +02:00
parent 6f5c47449c
commit ab4f61de97
1 changed files with 7 additions and 2 deletions

View File

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