1
0
mirror of https://github.com/matrix-org/matrix-react-sdk.git synced 2025-11-20 16:22:28 +03:00

Merge pull request #2799 from matrix-org/travis/widget-reload

Reload widget messaging when widgets reload
This commit is contained in:
Travis Ralston
2019-03-19 08:49:24 -06:00
committed by GitHub

View File

@@ -336,9 +336,14 @@ export default class AppTile extends React.Component {
* Called when widget iframe has finished loading * Called when widget iframe has finished loading
*/ */
_onLoaded() { _onLoaded() {
if (!ActiveWidgetStore.getWidgetMessaging(this.props.id)) { // Destroy the old widget messaging before starting it back up again. Some widgets
this._setupWidgetMessaging(); // 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); ActiveWidgetStore.setRoomId(this.props.id, this.props.room.roomId);
this.setState({loading: false}); this.setState({loading: false});
} }