Disable all widget assets on widget removal.

This commit is contained in:
Richard Lewis 2018-02-24 00:10:28 +00:00
parent 332892fee6
commit 86461bc88f
2 changed files with 37 additions and 0 deletions

View file

@ -55,6 +55,15 @@ export default class Stickerpack extends React.Component {
_removeStickerpackWidgets() {
console.warn('Removing stickerpack widgets');
if (this.widgetId) {
this.scalarClient.disableWidgetAssets('stickerpack', this.widgetId).then(() => {
console.warn('Assets disabled');
}).catch((err) => {
console.error('Failed to disable assets');
});
} else {
console.warn('No widget ID specified, not disabling assets');
}
Widgets.removeStickerpackWidgets();
this._getStickerPickerWidget();
this.stickersMenu.close();
@ -151,6 +160,7 @@ export default class Stickerpack extends React.Component {
// Default content to show if stickerpack widget not added
console.warn("No available sticker picker widgets");
stickersContent = this.defaultStickersContent;
this.widgetId = null;
this.forceUpdate();
}
this.setState({