Skip to content

Commit

Permalink
fix(core.gbapp): Images now working in WhatsApp.
Browse files Browse the repository at this point in the history
  • Loading branch information
rodrigorodriguez committed Aug 19, 2021
1 parent f9ab5b3 commit 525f465
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions packages/core.gbapp/services/GBConversationalService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -216,8 +216,7 @@ export class GBConversationalService {
}

public userMobile(step) {
if (!step)
{
if (!step) {
return 'N/A';
}
if (isNaN(step.context.activity['mobile'])) {
Expand Down Expand Up @@ -427,12 +426,13 @@ export class GBConversationalService {
text = text.replace(`](kb`, "](" + process.env.BOT_URL + '/kb'); // TODO: Improve it.

// According to the channel, formats the output optimized to it.
const mobile = this.userMobile(step);

if (channel === 'webchat' && GBConfigService.get('DISABLE_WEB') !== 'true') {
if (mobile) {
await this.sendMarkdownToMobile(min, step, user.systemUser.userSystemId, text);
} else if (GBConfigService.get('DISABLE_WEB') !== 'true') {
const html = marked(text);
await this.sendMarkdownToWeb(min, step, html, answer);
} else if (channel === 'whatsapp') {
await this.sendMarkdownToMobile(min, step, user.userSystemId, text);
} else {
const html = marked(text);
await min.conversationalService.sendText(min, step, html);
Expand Down

0 comments on commit 525f465

Please sign in to comment.