Skip to content

Commit

Permalink
fix(core.gbapp): Translator hierachy param tree is OK.
Browse files Browse the repository at this point in the history
  • Loading branch information
rodrigorodriguez committed Jun 4, 2021
1 parent 5021e7f commit 94e791c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 16 deletions.
4 changes: 2 additions & 2 deletions packages/core.gbapp/services/GBConversationalService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -805,8 +805,8 @@ export class GBConversationalService {
}
return false;
};
const endPoint = min.instance.translatorEndpoint;
const key = min.instance.translatorKey;
const endPoint = min.core.getParam<string>(min.instance, 'translatorEndpoint', null);
const key = min.core.getParam<string>(min.instance, 'translatorKey', null);

if (endPoint === null || !translatorEnabled() || process.env.TRANSLATOR_DISABLED === 'true') {
return text;
Expand Down
22 changes: 8 additions & 14 deletions packages/default.gbui/src/GBUIApp.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,8 @@ class GBUIApp extends React.Component {
}

postEvent(name, item) {
setTimeout(()=>{
window['botConnection'].postActivity({
setTimeout(() => {
window['botConnection'].postActivity({
type: "event",
name: name,
data: item,
Expand All @@ -107,8 +107,8 @@ class GBUIApp extends React.Component {
timestamp: new Date().toISOString(),
from: window.user
})
.subscribe(console.log("success"));
},400);
.subscribe(console.log("success"));
}, 400);
}
postMessage(value) {
window.line.postActivity({
Expand Down Expand Up @@ -193,21 +193,15 @@ class GBUIApp extends React.Component {
if (connectionStatus === ConnectionStatus.Online) {
_this_.setState({ line: line });
window['botConnection'] = line;
line.postActivity({
type: 'event',
value: 'startGB',
from: this.getUser(),
name: 'startGB'
});
}
});

window.line = line;
this.postEvent('startGB', true);

line.activity$
.filter(activity => activity.type === 'event' && activity.name === 'loadInstance')
.subscribe(activity => {
this.postEvent('startGB', true);
_this_.setState({ instance: activity.value });
_this_.authenticate();
});
Expand Down Expand Up @@ -315,7 +309,7 @@ class GBUIApp extends React.Component {

let chat = <div />;
let gbCss = <div />;
let seo= <div />;
let seo = <div />;

let sideBar = (
<div className="sidebar">
Expand All @@ -324,9 +318,9 @@ class GBUIApp extends React.Component {
);

if (this.state.line && this.state.instance) {
this.postEvent('startGB', true);

gbCss = <GBCss instance={this.state.instance} />;
seo = <SEO instance={this.state.instance}/>;
seo = <SEO instance={this.state.instance} />;

// let speechOptions;
// let token = this.state.instanceClient.speechToken;
Expand Down

0 comments on commit 94e791c

Please sign in to comment.