fix(core.gbapp): Autostart twice fixed.
This commit is contained in:
parent
5aa5f1ee3a
commit
23048760b6
1 changed files with 13 additions and 7 deletions
|
@ -638,6 +638,7 @@ export class GBMinService {
|
||||||
min.scriptMap = {};
|
min.scriptMap = {};
|
||||||
min.sandBoxMap = {};
|
min.sandBoxMap = {};
|
||||||
min["scheduleMap"] = {};
|
min["scheduleMap"] = {};
|
||||||
|
min["conversationWelcomed"] = {};
|
||||||
min.packages = sysPackages;
|
min.packages = sysPackages;
|
||||||
min.appPackages = appPackages;
|
min.appPackages = appPackages;
|
||||||
|
|
||||||
|
@ -917,17 +918,22 @@ export class GBMinService {
|
||||||
await step.beginDialog('/');
|
await step.beginDialog('/');
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
user.welcomed = true;
|
if (!min["conversationWelcomed"][step.context.activity.conversation.id]) {
|
||||||
|
|
||||||
|
min["conversationWelcomed"][step.context.activity.conversation.id] = true;
|
||||||
|
|
||||||
GBLog.info(`Auto start (web) dialog is now being called: ${startDialog} for ${min.instance.instanceId}...`);
|
GBLog.info(`Auto start (web) 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 {
|
||||||
GBLog.info(`Person added to conversation: ${member.name}`);
|
GBLog.info(`Person added to conversation: ${member.name}`);
|
||||||
|
|
||||||
if (this.userMobile(step)) {
|
if (this.userMobile(step)) {
|
||||||
if (startDialog && !user.welcomed) {
|
if (startDialog && !min["conversationWelcomed"][step.context.activity.conversation.id]) {
|
||||||
user.welcomed = true;
|
user.welcomed = true;
|
||||||
|
await min.userProfile.set(step.context, user);
|
||||||
GBLog.info(`Auto start (whatsapp) dialog is now being called: ${startDialog} for ${min.instance.instanceId}...`);
|
GBLog.info(`Auto start (whatsapp) 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);
|
||||||
}
|
}
|
||||||
|
@ -993,7 +999,7 @@ export class GBMinService {
|
||||||
});
|
});
|
||||||
} else if (context.activity.name === 'startGB') {
|
} else if (context.activity.name === 'startGB') {
|
||||||
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 && !min["conversationWelcomed"][step.context.activity.conversation.id]) {
|
||||||
user.welcomed = true;
|
user.welcomed = true;
|
||||||
GBLog.info(`Auto start (web) dialog is now being called: ${startDialog} for ${min.instance.instanceId}...`);
|
GBLog.info(`Auto start (web) 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);
|
||||||
|
|
Loading…
Add table
Reference in a new issue