Skip to content

Commit

Permalink
fix(core): jumpTo jumps to the right node when specified
Browse files Browse the repository at this point in the history
  • Loading branch information
slvnperron authored and emirotin committed Jun 1, 2018
1 parent 5111234 commit e8c2455
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions packages/core/botpress/src/dialog/engine.js
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,8 @@ bp.dialogEngine.onBeforeSessionTimeout((ctx, next) => {

await this._setContext(stateId, {
currentFlow: flow,
node: nodeName || flow.startNode,
hasJumped: true,
flowStack: [{ flow: flow.name, node: nodeName || flow.startNode }]
})

Expand Down Expand Up @@ -411,6 +413,11 @@ bp.dialogEngine.onBeforeSessionTimeout((ctx, next) => {
let switchedFlow = false
let switchedNode = false

if (context.hasJumped) {
context.hasJumped = false
switchedNode = true
}

const originalFlow = context.currentFlow.name
const originalNode = context.node

Expand Down

0 comments on commit e8c2455

Please sign in to comment.