Skip to content

Commit

Permalink
fix(core.gbapp): Start dialog now is called with no interruptions.
Browse files Browse the repository at this point in the history
  • Loading branch information
rodrigorodriguez committed Mar 30, 2021
1 parent 9b78594 commit f66bbb8
Showing 1 changed file with 20 additions and 13 deletions.
33 changes: 20 additions & 13 deletions packages/core.gbapp/services/GBMinService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1128,21 +1128,28 @@ export class GBMinService {

} else {

let nextDialog = null;
await CollectionUtil.asyncForEach(min.appPackages, async (e: IGBPackage) => {
nextDialog = await e.onExchangeData(min, 'handleAnswer', {
const startDialog = user.hearOnDialog ?
user.hearOnDialog :
min.core.getParam(min.instance, 'Start Dialog', null);

if (text !== startDialog) {
let nextDialog = null;
await CollectionUtil.asyncForEach(min.appPackages, async (e: IGBPackage) => {
nextDialog = await e.onExchangeData(min, 'handleAnswer', {
query: text,
step: step,
notTranslatedQuery: originalText,
message: message ? message['dataValues'] : null,
user: user ? user.dataValues : null
});
});
await step.beginDialog(nextDialog ? nextDialog : '/answer', {
query: text,
step: step,
notTranslatedQuery: originalText,
message: message ? message['dataValues'] : null,
user: user ? user.dataValues : null
user: user ? user.dataValues : null,
message: message
});
});
await step.beginDialog(nextDialog ? nextDialog : '/answer', {
query: text,
user: user ? user.dataValues : null,
message: message
});

}
}
}
}
Expand Down

0 comments on commit f66bbb8

Please sign in to comment.