Bug 1411794 - Fix bug where sync tabs panel would become permanently empty. r=eoger

MozReview-Commit-ID: 2mRAPhABCXA

--HG--
extra : rebase_source : cd004aef3b604a8d2426c0896d83a57003f2ea8d
This commit is contained in:
Thom Chiovoloni 2017-11-01 21:58:55 -04:00
parent 7ca44028ae
commit 837350c20d

View File

@ -358,10 +358,17 @@ const CustomizableWidgets = [
_showTabs(paginationInfo) {
this._showTabsPromise = this._showTabsPromise.then(() => {
return this.__showTabs(paginationInfo);
}, e => {
Cu.reportError(e);
});
},
// Return a new promise to update the tab list.
__showTabs(paginationInfo) {
if (!this._tabsList) {
// Closed between the previous `this._showTabsPromise`
// resolving and now.
return undefined;
}
let doc = this._tabsList.ownerDocument;
return SyncedTabs.getTabClients().then(clients => {
// The view may have been hidden while the promise was resolving.