Commit 72006224 authored by Brendan Dahl's avatar Brendan Dahl
Browse files

Bug 1548026 - Noop download button's changed callback when unloaded. r=bzbarsky

Temporary workaround to prevent wrapper assertions in torn-down
window.

Differential Revision: https://phabricator.services.mozilla.com/D29410

--HG--
extra : moz-landing-system : lando
parent 2bda356e
......@@ -50,6 +50,13 @@ const DownloadsButton = {
*/
_customizing: false,
/**
* Indicates whether the button has been torn down.
* TODO: This is used for a temporary workaround for bug 1543537 and should be
* removed when fixed.
*/
_uninitialized: false,
/**
* This function is called asynchronously just after window initialization.
*
......@@ -159,6 +166,9 @@ const DownloadsButton = {
},
checkForAutoHide() {
if (this._uninitialized) {
return;
}
let button = this._placeholder;
if (!this._customizing && this.autoHideDownloadsButton &&
button && button.closest("toolbar")) {
......@@ -213,6 +223,7 @@ const DownloadsButton = {
},
uninit() {
this._uninitialized = true;
CustomizableUI.removeListener(this);
},
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment