fix(core.gbapp): Logging about auto start.

This commit is contained in:
Rodrigo Rodriguez 2021-05-23 16:42:54 -03:00
parent e799524546
commit 3d42ab91bb
2 changed files with 13 additions and 11 deletions

View file

@ -313,7 +313,7 @@ export class GBMinService {
user.hearOnDialog : user.hearOnDialog :
activeMin.core.getParam(activeMin.instance, 'Start Dialog', null); activeMin.core.getParam(activeMin.instance, 'Start Dialog', null);
GBLog.info(`Auto start dialog is now being called: ${startDialog}...`); GBLog.info(`Auto start (1) dialog is now being called: ${startDialog} for ${activeMin.instance.instanceId}...`);
if (startDialog) { if (startDialog) {
req.body.messages[0].body = `/call ${startDialog}`; req.body.messages[0].body = `/call ${startDialog}`;
@ -342,7 +342,7 @@ export class GBMinService {
await sec.updateUserInstance(id, instance.instanceId); await sec.updateUserInstance(id, instance.instanceId);
await (activeMin as any).whatsAppDirectLine.resetConversationId(id); await (activeMin as any).whatsAppDirectLine.resetConversationId(id);
const startDialog = activeMin.core.getParam(activeMin.instance, 'Start Dialog', null); const startDialog = activeMin.core.getParam(activeMin.instance, 'Start Dialog', null);
GBLog.info(`Auto start dialog is now being called: ${startDialog}...`); GBLog.info(`Auto start (2) dialog is now being called: ${startDialog} for ${activeMin.instance.instanceId}...`);
if (startDialog) { if (startDialog) {
req.body.messages[0].body = `/call ${startDialog}`; req.body.messages[0].body = `/call ${startDialog}`;
@ -840,7 +840,7 @@ export class GBMinService {
const startDialog = min.core.getParam(min.instance, 'Start Dialog', null); const startDialog = min.core.getParam(min.instance, 'Start Dialog', null);
if (startDialog && !user.welcomed) { if (startDialog && !user.welcomed) {
user.welcomed = true; user.welcomed = true;
GBLog.info(`Auto start dialog is now being called: ${startDialog}...`); GBLog.info(`Auto start (3) dialog is now being called: ${startDialog} for ${min.instance.instanceId}...`);
await GBVMService.callVM(startDialog.toLowerCase(), min, step, this.deployer); await GBVMService.callVM(startDialog.toLowerCase(), min, step, this.deployer);
} else { } else {

View file

@ -84,11 +84,11 @@ export class AskDialog extends IGBDialog {
if (step.context.activity.channelId !== 'msteams' && process.env.ENABLE_AUTH) { if (step.context.activity.channelId !== 'msteams' && process.env.ENABLE_AUTH) {
return await step.beginDialog('/auth'); return await step.beginDialog('/auth');
} }
else{ else {
return await step.next(step.options); return await step.next(step.options);
} }
}, },
async step => { async step => {
const locale = step.context.activity.locale; const locale = step.context.activity.locale;
const user = await min.userProfile.get(step.context, {}); const user = await min.userProfile.get(step.context, {});
user.isAsking = true; user.isAsking = true;
@ -155,11 +155,11 @@ export class AskDialog extends IGBDialog {
if (step.context.activity.channelId !== 'msteams' && process.env.ENABLE_AUTH) { if (step.context.activity.channelId !== 'msteams' && process.env.ENABLE_AUTH) {
return await step.beginDialog('/auth'); return await step.beginDialog('/auth');
} }
else{ else {
return await step.next(step.options); return await step.next(step.options);
} }
}, },
async step => { async step => {
let answer: GuaribasAnswer = null; let answer: GuaribasAnswer = null;
const user = await min.userProfile.get(step.context, {}); const user = await min.userProfile.get(step.context, {});
@ -174,7 +174,9 @@ export class AskDialog extends IGBDialog {
if (!text) { if (!text) {
const startDialog = const startDialog =
min.core.getParam(min.instance, 'Start Dialog', null); min.core.getParam(min.instance, 'Start Dialog', null);
await GBVMService.callVM(startDialog.toLowerCase(), min, step, this.deployer); if (startDialog) {
await GBVMService.callVM(startDialog.toLowerCase().trim(), min, step, this.deployer);
}
return step.endDialog(); return step.endDialog();
} }
@ -278,7 +280,7 @@ export class AskDialog extends IGBDialog {
if (step.context.activity.channelId !== 'msteams' && process.env.ENABLE_AUTH) { if (step.context.activity.channelId !== 'msteams' && process.env.ENABLE_AUTH) {
return await step.beginDialog('/auth'); return await step.beginDialog('/auth');
} }
else{ else {
return await step.next(step.options); return await step.next(step.options);
} }
}, },