Skip to content

Commit

Permalink
fix(basic.gblib): Hear callback for login only active if ENABLE_AUTH …
Browse files Browse the repository at this point in the history
…is defined.
  • Loading branch information
Rodrigo Rodriguez(pragmatismo.io) committed Nov 16, 2021
1 parent 73db528 commit a628948
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions packages/basic.gblib/services/GBVMService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ export class GBVMService extends GBService {
tolist = this.getToLst;
headers = {};
hear gbLogin as login
${process.env.ENABLE_AUTH? `hear gbLogin as login`:``}
${code}
`;
Expand Down Expand Up @@ -241,9 +241,6 @@ export class GBVMService extends GBService {
return `${$1} = hear("menu", ${$2})`;
});

code = code.replace(/(go to)(\s)(.*)/gi, ($0, $1, $2, $3) => {
return `gotoDialog(step, ${$3})\n`;
});

code = code.replace(/(hear)\s*(\w+)/gi, ($0, $1, $2) => {
return `${$2} = hear()`;
Expand Down Expand Up @@ -297,6 +294,10 @@ export class GBVMService extends GBService {
}
});

code = code.replace(/(go to)(\s)(.*)/gi, ($0, $1, $2, $3) => {
return `gotoDialog(step, ${$3})\n`;
});

code = code.replace(/(set language)(\s*)(.*)/gi, ($0, $1, $2, $3) => {
return `setLanguage (step, ${$3})\n`;
});
Expand Down Expand Up @@ -531,6 +532,9 @@ export class GBVMService extends GBService {
code = code.replace(/("[^"]*"|'[^']*')|\bdateDiff\b/gi, ($0, $1) => {
return $1 === undefined ? 'this.dateDiff' : $1;
});
code = code.replace(/("[^"]*"|'[^']*')|\bgotoDialog\b/gi, ($0, $1) => {
return $1 === undefined ? 'this.gotoDialog' : $1;
});
code = code.replace(/("[^"]*"|'[^']*')|\bsetMaxLines\b/gi, ($0, $1) => {
return $1 === undefined ? 'this.setMaxLines' : $1;
});
Expand Down

0 comments on commit a628948

Please sign in to comment.