Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SM-330] Disable managed environments for safari #3953

Merged
merged 1 commit into from
Nov 15, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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