Fix duplicate message listeners
This commit is contained in:
parent
910623d287
commit
23bef68a8f
2 changed files with 14 additions and 10 deletions
|
@ -171,12 +171,8 @@ export default class AppTile extends React.Component {
|
|||
|
||||
// Widget postMessage listeners
|
||||
try {
|
||||
if (this.widgetMessaging) {
|
||||
this.widgetMessaging.stopListening();
|
||||
this.widgetMessaging.removeEndpoint(this.props.id, this.props.url);
|
||||
} else {
|
||||
console.warn('WidgetMessaging not initialised. Not stopping.');
|
||||
}
|
||||
this.widgetMessaging.stopListening();
|
||||
this.widgetMessaging.removeEndpoint(this.props.id, this.props.url);
|
||||
} catch (e) {
|
||||
console.error('Failed to stop listening for widgetMessaging events', e.message);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue