From 7fca2d722c8d5dc9a6448bc82b3a113af0a319ec 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 384d22fda5..b3aab9a7a1 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);