fix(core.gbapp): Translator hierachy param tree is OK.

This commit is contained in:
Rodrigo Rodriguez 2021-06-04 11:55:07 -03:00
parent 5021e7fcf1
commit 94e791ca71
2 changed files with 10 additions and 16 deletions

View file

@ -805,8 +805,8 @@ export class GBConversationalService {
} }
return false; return false;
}; };
const endPoint = min.instance.translatorEndpoint; const endPoint = min.core.getParam<string>(min.instance, 'translatorEndpoint', null);
const key = min.instance.translatorKey; const key = min.core.getParam<string>(min.instance, 'translatorKey', null);
if (endPoint === null || !translatorEnabled() || process.env.TRANSLATOR_DISABLED === 'true') { if (endPoint === null || !translatorEnabled() || process.env.TRANSLATOR_DISABLED === 'true') {
return text; return text;

View file

@ -97,7 +97,7 @@ class GBUIApp extends React.Component {
} }
postEvent(name, item) { postEvent(name, item) {
setTimeout(()=>{ setTimeout(() => {
window['botConnection'].postActivity({ window['botConnection'].postActivity({
type: "event", type: "event",
name: name, name: name,
@ -108,7 +108,7 @@ class GBUIApp extends React.Component {
from: window.user from: window.user
}) })
.subscribe(console.log("success")); .subscribe(console.log("success"));
},400); }, 400);
} }
postMessage(value) { postMessage(value) {
window.line.postActivity({ window.line.postActivity({
@ -193,21 +193,15 @@ class GBUIApp extends React.Component {
if (connectionStatus === ConnectionStatus.Online) { if (connectionStatus === ConnectionStatus.Online) {
_this_.setState({ line: line }); _this_.setState({ line: line });
window['botConnection'] = line; window['botConnection'] = line;
line.postActivity({
type: 'event',
value: 'startGB',
from: this.getUser(),
name: 'startGB'
});
} }
}); });
window.line = line; window.line = line;
this.postEvent('startGB', true);
line.activity$ line.activity$
.filter(activity => activity.type === 'event' && activity.name === 'loadInstance') .filter(activity => activity.type === 'event' && activity.name === 'loadInstance')
.subscribe(activity => { .subscribe(activity => {
this.postEvent('startGB', true);
_this_.setState({ instance: activity.value }); _this_.setState({ instance: activity.value });
_this_.authenticate(); _this_.authenticate();
}); });
@ -315,7 +309,7 @@ class GBUIApp extends React.Component {
let chat = <div />; let chat = <div />;
let gbCss = <div />; let gbCss = <div />;
let seo= <div />; let seo = <div />;
let sideBar = ( let sideBar = (
<div className="sidebar"> <div className="sidebar">
@ -324,9 +318,9 @@ class GBUIApp extends React.Component {
); );
if (this.state.line && this.state.instance) { if (this.state.line && this.state.instance) {
this.postEvent('startGB', true);
gbCss = <GBCss instance={this.state.instance} />; gbCss = <GBCss instance={this.state.instance} />;
seo = <SEO instance={this.state.instance}/>; seo = <SEO instance={this.state.instance} />;
// let speechOptions; // let speechOptions;
// let token = this.state.instanceClient.speechToken; // let token = this.state.instanceClient.speechToken;