1
0
mirror of https://github.com/bitwarden/browser.git synced 2024-11-22 11:45:59 +01:00

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

This commit is contained in:
Oscar Hinton 2022-11-15 14:13:37 +01:00 committed by GitHub
parent 635973d458
commit 7fca2d722c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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);