mirror of
https://github.com/element-hq/element-web
synced 2024-11-23 17:56:01 +03:00
Reload widget messaging when widgets reload
Fixes a bug for some widgets where they cannot do their startup routine (capabilities negotiation, etc) when someone maximizes the widget. By reloading the widget messaging, we ensure the widget is kept in the loop.
This commit is contained in:
parent
62f45807fe
commit
b68960ad26
1 changed files with 7 additions and 2 deletions
|
@ -336,9 +336,14 @@ export default class AppTile extends React.Component {
|
|||
* Called when widget iframe has finished loading
|
||||
*/
|
||||
_onLoaded() {
|
||||
if (!ActiveWidgetStore.getWidgetMessaging(this.props.id)) {
|
||||
this._setupWidgetMessaging();
|
||||
// Destroy the old widget messaging before starting it back up again. Some widgets
|
||||
// have startup routines that run when they are loaded, so we just need to reinitialize
|
||||
// the messaging for them.
|
||||
if (ActiveWidgetStore.getWidgetMessaging(this.props.id)) {
|
||||
ActiveWidgetStore.delWidgetMessaging(this.props.id);
|
||||
}
|
||||
this._setupWidgetMessaging();
|
||||
|
||||
ActiveWidgetStore.setRoomId(this.props.id, this.props.room.roomId);
|
||||
this.setState({loading: false});
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue