From 4d484d0a67965a1841fcd8a9e5bea13bb7a577b1 Mon Sep 17 00:00:00 2001 From: Rodrigo Rodriguez Date: Tue, 4 Jun 2019 11:21:32 -0300 Subject: [PATCH] fix(core.gbapp): Self-replication on Azure --- packages/core.gbapp/services/GBMinService.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/packages/core.gbapp/services/GBMinService.ts b/packages/core.gbapp/services/GBMinService.ts index 87b1b299..7d48a084 100644 --- a/packages/core.gbapp/services/GBMinService.ts +++ b/packages/core.gbapp/services/GBMinService.ts @@ -232,7 +232,7 @@ export class GBMinService { */ private async sendInstanceToClient(req, bootInstance: IGBInstance, res: any, webchatToken: any) { let botId = req.params.botId; - if (botId === '[default]'|| botId === undefined) { + if (botId === '[default]' || botId === undefined) { botId = GBConfigService.get('BOT_ID'); } const instance = await this.core.loadInstance(botId); @@ -377,7 +377,7 @@ export class GBMinService { if (p.getDialogs !== undefined) { const dialogs = p.getDialogs(min); dialogs.forEach(dialog => { - min.dialogs.add(new WaterfallDialog(dialog.name, dialog.waterfall)); + min.dialogs.add(new WaterfallDialog(dialog.id, dialog.waterfall)); }); } }, this); @@ -497,6 +497,9 @@ export class GBMinService { min.sandBoxMap[mainMethod].step = step; min.sandBoxMap[mainMethod][mainMethod].bind(min.sandBoxMap[mainMethod]); await min.sandBoxMap[mainMethod][mainMethod](); + } else if (context.activity.text.charAt(0) === '/') { + await step.beginDialog(context.activity.text); + } else if (context.activity.text === 'admin') { await step.beginDialog('/admin');