Bug 1163917 - Remove the widget from its area if the conditionalDestroy promise is resolved truthy. r=gijs, a=sledru

This commit is contained in:
Jared Wein
2015-05-18 12:49:25 -04:00
parent 1f7181077c
commit 8148adb697

View File

@@ -2180,9 +2180,9 @@ let CustomizableUIInternal = {
// current placement settings. // current placement settings.
// This allows a widget to be both built-in by default but also able to be // This allows a widget to be both built-in by default but also able to be
// destroyed based on criteria that may not be available when the widget is // destroyed and removed from the area based on criteria that may not be
// created -- for example, because some other feature in the browser // available when the widget is created -- for example, because some other
// supersedes the widget. // feature in the browser supersedes the widget.
let conditionalDestroyPromise = aData.conditionalDestroyPromise || null; let conditionalDestroyPromise = aData.conditionalDestroyPromise || null;
delete aData.conditionalDestroyPromise; delete aData.conditionalDestroyPromise;
@@ -2199,6 +2199,7 @@ let CustomizableUIInternal = {
conditionalDestroyPromise.then(shouldDestroy => { conditionalDestroyPromise.then(shouldDestroy => {
if (shouldDestroy) { if (shouldDestroy) {
this.destroyWidget(widget.id); this.destroyWidget(widget.id);
this.removeWidgetFromArea(widget.id);
} }
}, err => { }, err => {
Cu.reportError(err); Cu.reportError(err);