Skip to content

Commit

Permalink
Merge pull request #763 from botpress/keep-choice-links-on-edit
Browse files Browse the repository at this point in the history
fix(core): keep choice-skills' links on skill edit (resolve #693)
  • Loading branch information
slvnperron committed Jul 23, 2018
2 parents 8c13ca6 + b2a91ce commit 8e5a96b
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions packages/core/botpress/src/web/reducers/flows.js
Expand Up @@ -407,9 +407,13 @@ reducer = reduceReducers(
return node
}

return Object.assign({}, node, {
next: payload.transitions
})
return {
...node,
next: payload.transitions.map(transition => {
const prevTransition = node.next.find(({ condition }) => condition === transition.condition)
return { ...transition, node: (prevTransition || {}).node || '' }
})
}
})

return {
Expand Down

0 comments on commit 8e5a96b

Please sign in to comment.