From c6e288c235cd7c103a277d83e13d156f597088d6 Mon Sep 17 00:00:00 2001 From: Oscar Hinton Date: Tue, 15 Nov 2022 14:13:37 +0100 Subject: [PATCH] [SM-330] Disable managed environments for safari (#3953) --- apps/browser/src/services/browser-environment.service.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/apps/browser/src/services/browser-environment.service.ts b/apps/browser/src/services/browser-environment.service.ts index 384d22fda519..b3aab9a7a10a 100644 --- a/apps/browser/src/services/browser-environment.service.ts +++ b/apps/browser/src/services/browser-environment.service.ts @@ -20,6 +20,10 @@ export class BrowserEnvironmentService extends EnvironmentService { } async settingsHaveChanged() { + if (!(await this.hasManagedEnvironment())) { + return false; + } + const env = await this.getManagedEnvironment(); return ( @@ -37,6 +41,10 @@ export class BrowserEnvironmentService extends EnvironmentService { return devFlagEnabled("managedEnvironment") ? new Promise((resolve) => resolve(devFlagValue("managedEnvironment"))) : new Promise((resolve, reject) => { + if (chrome.storage.managed == null) { + return resolve(null); + } + chrome.storage.managed.get("environment", (result) => { if (chrome.runtime.lastError) { return reject(chrome.runtime.lastError);