From 07a10292274cbabc3c875bcd6f729e7ea91172e6 Mon Sep 17 00:00:00 2001 From: mpicciolli Date: Fri, 16 Feb 2018 23:34:29 +0100 Subject: [PATCH] Issue : onSelectAction of cancelAction is called before user has a chance to confirm (#181) --- Node/core-globalMessageHandlers/bot.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Node/core-globalMessageHandlers/bot.js b/Node/core-globalMessageHandlers/bot.js index 879d13e0a0..f633c90f6b 100644 --- a/Node/core-globalMessageHandlers/bot.js +++ b/Node/core-globalMessageHandlers/bot.js @@ -49,8 +49,9 @@ bot.dialog('AddNumber', [ .triggerAction({matches: /^add$/i}) .cancelAction('CancelAddNumber', 'Operation cancelled', { matches: /^cancel$/, - onSelectAction: (session, args) => { + onSelectAction: (session, args, next) => { session.endConversation(`Operation cancelled.`); + next(); }, confirmPrompt: `Are you sure you wish to cancel?` })