diff --git a/src/_locales b/src/_locales index d330106..985531f 160000 --- a/src/_locales +++ b/src/_locales @@ -1 +1 @@ -Subproject commit d3301069f51262e8cf493a86aa2785cf3261141e +Subproject commit 985531f5c9a4187c0fd172032933c0cc813ab49d diff --git a/src/js/popup.js b/src/js/popup.js index 236e393..d485d4b 100644 --- a/src/js/popup.js +++ b/src/js/popup.js @@ -81,7 +81,10 @@ const Logic = { } // Routing to the correct panel. - // If localStorage is disabled, we don't show the onboarding. + // + // We do not show the onboarding panel when: + // 1. localStorage is disabled + // 2. `disableOnboarding` is set to `true` in the enterprise policies const onboardingData = await browser.storage.local.get([ONBOARDING_STORAGE_KEY]); let onboarded = onboardingData[ONBOARDING_STORAGE_KEY]; if (!onboarded) { @@ -89,6 +92,23 @@ const Logic = { this.setOnboardingStage(onboarded); } + // If a polices file or a key in it do not exists, an error is raised. + // As a workaround, we catch and ignore the error if there is one. See + // https://bugzilla.mozilla.org/show_bug.cgi?id=1868153 + let disableOnboarding = false; + try { + const managedStorage = + await browser.storage.managed.get("disableOnboarding"); + disableOnboarding = managedStorage.disableOnboarding; + } catch(e) { + // ignore error + } + + if (disableOnboarding) { + onboarded = 8; + this.setOnboardingStage(onboarded); + } + switch (onboarded) { case 8: this.showAchievementOrContainersListPanel();