fix(basic.gblib): Goto dialog within web.
This commit is contained in:
parent
7c446699eb
commit
565f200ebf
2 changed files with 13 additions and 9 deletions
|
@ -455,6 +455,9 @@ export class DialogKeywords {
|
||||||
*/
|
*/
|
||||||
public async gotoDialog(step, fromOrDialogName: string, dialogName: string) {
|
public async gotoDialog(step, fromOrDialogName: string, dialogName: string) {
|
||||||
if (dialogName) {
|
if (dialogName) {
|
||||||
|
if (dialogName.charAt(0) === '/') {
|
||||||
|
await step.beginDialog(fromOrDialogName);
|
||||||
|
} else {
|
||||||
let sec = new SecService();
|
let sec = new SecService();
|
||||||
let user = await sec.getUserFromSystemId(fromOrDialogName);
|
let user = await sec.getUserFromSystemId(fromOrDialogName);
|
||||||
if (!user) {
|
if (!user) {
|
||||||
|
@ -463,8 +466,9 @@ export class DialogKeywords {
|
||||||
}
|
}
|
||||||
await sec.updateUserHearOnDialog(user.userId, dialogName);
|
await sec.updateUserHearOnDialog(user.userId, dialogName);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
else {
|
else {
|
||||||
await step.beginDialog(dialogName);
|
await step.beginDialog(fromOrDialogName);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -242,7 +242,7 @@ export class GBVMService extends GBService {
|
||||||
});
|
});
|
||||||
|
|
||||||
code = code.replace(/(go to)(\s)(.*)/gi, ($0, $1, $2, $3) => {
|
code = code.replace(/(go to)(\s)(.*)/gi, ($0, $1, $2, $3) => {
|
||||||
return `sys().gotoDialog(step, ${$3})\n`;
|
return `gotoDialog(step, ${$3})\n`;
|
||||||
});
|
});
|
||||||
|
|
||||||
code = code.replace(/(hear)\s*(\w+)/gi, ($0, $1, $2) => {
|
code = code.replace(/(hear)\s*(\w+)/gi, ($0, $1, $2) => {
|
||||||
|
|
Loading…
Add table
Reference in a new issue