Skip to content

Commit

Permalink
fix(all): MSTeams fixes.
Browse files Browse the repository at this point in the history
  • Loading branch information
rodrigorodriguez committed Apr 26, 2022
1 parent 6778f2e commit d6f8574
Show file tree
Hide file tree
Showing 5 changed files with 251 additions and 236 deletions.
3 changes: 2 additions & 1 deletion packages/core.gbapp/services/GBConversationalService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,8 @@ export class GBConversationalService {
}

public async sendEvent(min: GBMinInstance, step: GBDialogStep, name: string, value: Object): Promise<any> {
if (!this.userMobile(step)) {
if (!this.userMobile(step) &&
step.context.activity.channelId !== 'msteams') {
GBLog.info(`Sending event ${name}:${typeof value === 'object' ? JSON.stringify(value) :
value ? value : ''} to client...`);
const msg = MessageFactory.text('');
Expand Down
9 changes: 6 additions & 3 deletions packages/core.gbapp/services/GBMinService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ export class GBMinService {
setTimeout(resolve, ms);
});
};
await sleep(10000);
await sleep(20000);
res.status(200);
res.end();
});
Expand Down Expand Up @@ -889,8 +889,9 @@ export class GBMinService {

const sec = new SecService();
if (!user.loaded) {

await min.conversationalService.sendEvent(min, step, 'loadInstance', {});
if (step.context.activity.channelId !== 'msteams') {
await min.conversationalService.sendEvent(min, step, 'loadInstance', {});
}

user.loaded = true;
user.subjects = [];
Expand Down Expand Up @@ -925,12 +926,14 @@ export class GBMinService {

}

if (step.context.activity.channelId !== 'msteams') {
const service = new KBService(min.core.sequelize);
const data = await service.getFaqBySubjectArray(instance.instanceId, 'faq', undefined);
await min.conversationalService.sendEvent(min, step, 'play', {
playerType: 'bullet',
data: data.slice(0, 10)
});
}

// Saves session user (persisted GuaribasUser is inside).

Expand Down
Loading

0 comments on commit d6f8574

Please sign in to comment.