Bug 1571639 - Don't add distro bookmarks if profile has been reset. r=MattN

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

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Michael Kaply 2019-08-21 22:18:37 +00:00
Родитель 20f01277a6
Коммит 75cc371860
1 изменённых файлов: 13 добавлений и 3 удалений

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

@ -314,9 +314,19 @@ DistributionCustomizer.prototype = {
".bookmarksProcessed"; ".bookmarksProcessed";
} }
let bmProcessed = Services.prefs.getBoolPref(bmProcessedPref, false); if (Services.prefs.getBoolPref(bmProcessedPref, false)) {
return;
}
if (!bmProcessed) { let ProfileAge = ChromeUtils.import(
"resource://gre/modules/ProfileAge.jsm",
{}
).ProfileAge;
let profileAge = await ProfileAge();
let resetDate = await profileAge.reset;
// If the profile has been reset, don't recreate bookmarks.
if (!resetDate) {
if (sections.BookmarksMenu) { if (sections.BookmarksMenu) {
await this._parseBookmarksSection( await this._parseBookmarksSection(
PlacesUtils.bookmarks.menuGuid, PlacesUtils.bookmarks.menuGuid,
@ -329,8 +339,8 @@ DistributionCustomizer.prototype = {
"BookmarksToolbar" "BookmarksToolbar"
); );
} }
Services.prefs.setBoolPref(bmProcessedPref, true);
} }
Services.prefs.setBoolPref(bmProcessedPref, true);
}, },
_prefDefaultsApplied: false, _prefDefaultsApplied: false,