Skip to content

Commit

Permalink
[SM-330] Disable managed environments for safari (#3953)
Browse files Browse the repository at this point in the history
  • Loading branch information
Hinton authored and rr-bw committed Jan 10, 2023
1 parent 549b27c commit c6e288c
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions apps/browser/src/services/browser-environment.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ export class BrowserEnvironmentService extends EnvironmentService {
}

async settingsHaveChanged() {
if (!(await this.hasManagedEnvironment())) {
return false;
}

const env = await this.getManagedEnvironment();

return (
Expand All @@ -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);
Expand Down

0 comments on commit c6e288c

Please sign in to comment.