Merge pull request #987 from gobigfoot/patch/react-bot-framework
Patch issue #871. Added componentDidMount
This commit is contained in:
commit
c6354074d8
|
@ -35,8 +35,17 @@ export default class BotFrameworkChat extends React.Component<IBotFrameworkChatP
|
|||
);
|
||||
}
|
||||
|
||||
public componentDidMount(){
|
||||
this.initSwagger();
|
||||
}
|
||||
|
||||
public componentDidUpdate(prevProps: IBotFrameworkChatProps, prevState: {}, prevContext: any): void {
|
||||
if (this.props.directLineSecret !== prevProps.directLineSecret) {
|
||||
this.initSwagger();
|
||||
}
|
||||
}
|
||||
|
||||
public initSwagger(){
|
||||
if (this.props.directLineSecret) {
|
||||
var Swagger = require('swagger-client');
|
||||
var directLineSpec = require('./directline-swagger.json');
|
||||
|
@ -68,7 +77,6 @@ export default class BotFrameworkChat extends React.Component<IBotFrameworkChatP
|
|||
this.printMessage = this.printMessage.bind(this);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public getMessagesHtml() {
|
||||
return this.messagesHtml;
|
||||
|
|
Loading…
Reference in New Issue