Merge branch 'rxl881/snapshot' of github.com:matrix-org/matrix-react-sdk into rxl881/snapshot

This commit is contained in:
Richard Lewis 2018-01-04 09:53:29 +00:00
commit b85efa08ce
2 changed files with 4 additions and 3 deletions

View file

@ -175,8 +175,9 @@ if (!global.mxWidgetMessagingMessageEndpoints) {
}
export default class WidgetMessaging extends MatrixPostMessageApi {
constructor(targetWindow) {
constructor(widgetId, targetWindow) {
super(targetWindow);
this.widgetId = widgetId;
}
exec(action) {

View file

@ -334,11 +334,11 @@ export default React.createClass({
*/
_onLoaded() {
// console.warn("App frame", this.refs.appFrame.contentWindow);
this.widgetMessaging = new WidgetMessaging(this.refs.appFrame.contentWindow);
this.widgetMessaging = new WidgetMessaging(this.props.id, this.refs.appFrame.contentWindow);
this.widgetMessaging.startListening();
this.widgetMessaging.addEndpoint(this.props.id, this.props.url);
this.widgetMessaging.getCapabilities().then((capabilities) => {
console.log("Got widget capabilities", this.widgetId, capabilities);
console.log("Got widget capabilities", this.props.id, capabilities);
capabilities = capabilities || [];
this.setState({capabilities});
}).catch((err) => {