mirror of
https://github.com/element-hq/element-web.git
synced 2024-11-30 23:31:28 +03:00
Merge branch 'rxl881/snapshot' of github.com:matrix-org/matrix-react-sdk into rxl881/snapshot
This commit is contained in:
commit
b85efa08ce
2 changed files with 4 additions and 3 deletions
|
@ -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) {
|
||||
|
|
|
@ -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) => {
|
||||
|
|
Loading…
Reference in a new issue