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 :
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) {
req.body.messages[0].body = `/call ${startDialog}`;
@ -342,7 +342,7 @@ export class GBMinService {
await sec.updateUserInstance(id, instance.instanceId);
await (activeMin as any).whatsAppDirectLine.resetConversationId(id);
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) {
req.body.messages[0].body = `/call ${startDialog}`;
@ -840,7 +840,7 @@ export class GBMinService {
const startDialog = min.core.getParam(min.instance, 'Start Dialog', null);
if (startDialog && !user.welcomed) {
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);
} else {

View file

@ -84,11 +84,11 @@ export class AskDialog extends IGBDialog {
if (step.context.activity.channelId !== 'msteams' && process.env.ENABLE_AUTH) {
return await step.beginDialog('/auth');
}
else{
else {
return await step.next(step.options);
}
},
async step => {
async step => {
const locale = step.context.activity.locale;
const user = await min.userProfile.get(step.context, {});
user.isAsking = true;
@ -108,9 +108,9 @@ export class AskDialog extends IGBDialog {
} else {
throw new Error('Invalid use of /ask');
}
return await min.conversationalService.prompt(min, step, text);
},
async step => {
if (step.result) {
@ -155,11 +155,11 @@ export class AskDialog extends IGBDialog {
if (step.context.activity.channelId !== 'msteams' && process.env.ENABLE_AUTH) {
return await step.beginDialog('/auth');
}
else{
else {
return await step.next(step.options);
}
},
async step => {
async step => {
let answer: GuaribasAnswer = null;
const user = await min.userProfile.get(step.context, {});
@ -174,7 +174,9 @@ export class AskDialog extends IGBDialog {
if (!text) {
const startDialog =
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();
}
@ -278,7 +280,7 @@ export class AskDialog extends IGBDialog {
if (step.context.activity.channelId !== 'msteams' && process.env.ENABLE_AUTH) {
return await step.beginDialog('/auth');
}
else{
else {
return await step.next(step.options);
}
},