fix(core.gbapp): Language instance acquisition fixed.

This commit is contained in:
Rodrigo Rodriguez 2020-11-26 11:25:04 -03:00
parent 2b74c3c7e1
commit 387b3407f3
2 changed files with 8 additions and 2 deletions

View file

@ -532,8 +532,12 @@ export class GBConversationalService {
}
public async getLanguage(min: GBMinInstance, text: string): Promise<string> {
const key = min.core.getParam<string>(min.instance, 'textAnalyticsKey', null);
if (!key) {
return process.env.DEFAULT_USER_LANGUAGE;
}
return await AzureText.getLocale(
min.core.getParam<string>(min.instance, 'textAnalyticsKey', null),
key,
min.core.getParam<string>(min.instance, 'textAnalyticsEndpoint', null),
text
);

View file

@ -594,7 +594,9 @@ STORAGE_SYNC=true
value = instance['dataValues'][name];
if (value === null) {
const minBoot = GBServer.globals.minBoot as any;
value = minBoot.instance.datavalues[name];
if (minBoot.instance && minBoot.instance.datavalues){
value = minBoot.instance.datavalues[name];
}
}
}