Don't set the data object unless we have data to set.

Fixes #121
This commit is contained in:
Travis Ralston 2017-10-10 22:32:08 -06:00
parent 3eddf325b5
commit 2d3c140b26
2 changed files with 3 additions and 2 deletions

View File

@ -106,8 +106,8 @@ export class WidgetComponent {
url: this.wrapUrl(this.newWidgetUrl), url: this.wrapUrl(this.newWidgetUrl),
type: this.primaryWidgetType, type: this.primaryWidgetType,
name: this.newWidgetName || this.defaultName, name: this.newWidgetName || this.defaultName,
data: data,
}; };
if (data) constructedWidget.data = data;
this.isUpdating = true; this.isUpdating = true;
this.scalarApi.setWidget(this.roomId, constructedWidget) this.scalarApi.setWidget(this.roomId, constructedWidget)

View File

@ -52,7 +52,8 @@ export class YoutubeWidgetConfigComponent extends WidgetComponent implements Mod
return; return;
} }
widget.data = {dimOriginalUrl: widget.newUrl}; if (!widget.data) widget.data = {};
widget.data.dimOriginalUrl = widget.newUrl;
widget.newUrl = url; widget.newUrl = url;
this.saveWidget(widget); this.saveWidget(widget);
} }