You've already forked matrix-react-sdk
mirror of
https://github.com/matrix-org/matrix-react-sdk.git
synced 2025-11-13 08:02:38 +03:00
When stickerpicker made visible, send visibility over postMessage
This commit is contained in:
@@ -167,6 +167,19 @@ export default class AppTile extends React.Component {
|
||||
|
||||
// Widget action listeners
|
||||
this.dispatcherRef = dis.register(this._onWidgetAction);
|
||||
|
||||
}
|
||||
|
||||
componentDidUpdate() {
|
||||
// Allow parents to access widget messaging
|
||||
if (this.props.collectWidgetMessaging) {
|
||||
this.props.collectWidgetMessaging(new Promise((resolve) => {
|
||||
if (this.widgetMessaging) resolve(this.widgetMessaging);
|
||||
|
||||
// Expect this to be resolved later
|
||||
this._exposeWidgetMessaging = resolve;
|
||||
}));
|
||||
}
|
||||
}
|
||||
|
||||
componentWillUnmount() {
|
||||
@@ -352,6 +365,9 @@ export default class AppTile extends React.Component {
|
||||
if (!this.widgetMessaging) {
|
||||
this._onInitialLoad();
|
||||
}
|
||||
if (this._exposeWidgetMessaging) {
|
||||
this._exposeWidgetMessaging(this.widgetMessaging);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -390,9 +406,6 @@ export default class AppTile extends React.Component {
|
||||
console.log(`Failed to get capabilities for widget type ${this.props.type}`, this.props.id, err);
|
||||
});
|
||||
|
||||
// Allow parents to access widget messaging
|
||||
if (this.props.collectWidgetMessaging) this.props.collectWidgetMessaging(this.widgetMessaging);
|
||||
|
||||
this.setState({loading: false});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user