Bug 1508777 Skip updates for LWTs with no updateURL r=kmag

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

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Andrew Swan 2018-12-19 03:58:49 +00:00
Родитель ac74e72736
Коммит 1520f7332f
1 изменённых файлов: 5 добавлений и 1 удалений

Просмотреть файл

@ -279,6 +279,10 @@ var LightweightThemeManager = {
* xpi packaged theme).
*/
async _updateOneTheme(theme, isCurrent) {
if (!theme.updateURL) {
return theme;
}
let req = new ServiceRequest();
req.mozBackgroundRequest = true;
@ -364,7 +368,7 @@ var LightweightThemeManager = {
let selectedID = _prefs.getStringPref("selectedThemeID", DEFAULT_THEME_ID);
let newThemes = await Promise.all(allThemes.map(
t => this._updateOneTheme(t, t.id == selectedID)));
t => this._updateOneTheme(t, t.id == selectedID).catch(err => {})));
newThemes = newThemes.filter(t => t);
_prefs.setStringPref("usedThemes", JSON.stringify(newThemes));
},