You've already forked matrix-react-sdk
mirror of
https://github.com/matrix-org/matrix-react-sdk.git
synced 2025-07-28 15:22:05 +03:00
Add API to send visibiliy actions to widgets
This commit is contained in:
@ -94,6 +94,16 @@ export default class WidgetMessaging {
|
||||
});
|
||||
}
|
||||
|
||||
sendVisibility(visible) {
|
||||
return this.messageToWidget({
|
||||
api: OUTBOUND_API_NAME,
|
||||
action: "visibility",
|
||||
visible,
|
||||
})
|
||||
.catch((error) => {
|
||||
console.error("Failed to send visibility: ", error);
|
||||
});
|
||||
}
|
||||
|
||||
start() {
|
||||
this.fromWidget.addEndpoint(this.widgetId, this.widgetUrl);
|
||||
|
@ -394,6 +394,10 @@ export default class AppTile extends React.Component {
|
||||
}).catch((err) => {
|
||||
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