fix(core.gbapp): Fixing .gbdialog last call error.

This commit is contained in:
Rodrigo Rodriguez 2020-11-09 18:29:23 -03:00
parent e130d63a91
commit ff20ef2494
2 changed files with 4 additions and 1 deletions

View file

@ -539,11 +539,14 @@ export class DialogClass {
// TODO: Choose Fuse with country code or consent IP. // TODO: Choose Fuse with country code or consent IP.
} }
public async sendFile(step, filename, caption) { public async sendFile(step, filename, caption) {
if (filename.indexOf('.md') > -1) { if (filename.indexOf('.md') > -1) {
GBLog.info(`BASIC: Sending the contents of ${filename} markdown to mobile.`);
let md = await this.min.kbService.getAnswerTextByMediaName(this.min.instance.instanceId, filename); let md = await this.min.kbService.getAnswerTextByMediaName(this.min.instance.instanceId, filename);
await this.min.conversationalService.sendMarkdownToMobile(this.min, step, null, md); await this.min.conversationalService.sendMarkdownToMobile(this.min, step, null, md);
} else { } else {
GBLog.info(`BASIC: Sending the file ${filename} to mobile.`);
let url = urlJoin( let url = urlJoin(
GBServer.globals.publicAddress, GBServer.globals.publicAddress,
'kb', 'kb',

View file

@ -378,7 +378,7 @@ export class GBVMService extends GBService {
async step => { async step => {
const cbId = step.activeDialog.state.options.cbId; const cbId = step.activeDialog.state.options.cbId;
if (min.cbMap[cbId] !== null) { if (min.cbMap[cbId]) {
const promise = min.cbMap[cbId].promise; const promise = min.cbMap[cbId].promise;
delete min.cbMap[cbId]; delete min.cbMap[cbId];
try { try {