General cleanup of handling for WidgetMessaging instances
When setting, delete the old one. Because delete checks if it exists first, we can safely call this. The change in FromWidgetPostMessageApi is just something noticed while debugging.
This commit is contained in:
parent
a4f76670c4
commit
51750cf153
3 changed files with 5 additions and 7 deletions
|
@ -116,6 +116,8 @@ class ActiveWidgetStore extends EventEmitter {
|
|||
}
|
||||
|
||||
setWidgetMessaging(widgetId, wm) {
|
||||
// Stop any existing widget messaging first
|
||||
this.delWidgetMessaging(widgetId);
|
||||
this._widgetMessagingByWidgetId[widgetId] = wm;
|
||||
this.emit('update');
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue