1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-21 10:43:35 +00:00

[PM-13099] Enable browserintegration on dmg builds on adding an env variable (#11359)

* Enable browserintegration on dmg builds on adding an env variable

* Fix crash

* Cleanup
This commit is contained in:
Bernd Schoolmann
2024-12-09 02:09:57 -08:00
committed by GitHub
parent d5af932cef
commit 3bfe5e4a65
3 changed files with 62 additions and 35 deletions

View File

@@ -632,43 +632,51 @@ export class SettingsComponent implements OnInit, OnDestroy {
}
async saveBrowserIntegration() {
if (
ipc.platform.deviceType === DeviceType.MacOsDesktop &&
!this.platformUtilsService.isMacAppStore() &&
!ipc.platform.isDev
) {
await this.dialogService.openSimpleDialog({
title: { key: "browserIntegrationUnsupportedTitle" },
content: { key: "browserIntegrationMasOnlyDesc" },
acceptButtonText: { key: "ok" },
cancelButtonText: null,
type: "warning",
});
const skipSupportedPlatformCheck =
ipc.platform.allowBrowserintegrationOverride || ipc.platform.isDev;
this.form.controls.enableBrowserIntegration.setValue(false);
return;
} else if (ipc.platform.isWindowsStore) {
await this.dialogService.openSimpleDialog({
title: { key: "browserIntegrationUnsupportedTitle" },
content: { key: "browserIntegrationWindowsStoreDesc" },
acceptButtonText: { key: "ok" },
cancelButtonText: null,
type: "warning",
});
if (skipSupportedPlatformCheck) {
if (
ipc.platform.deviceType === DeviceType.MacOsDesktop &&
!this.platformUtilsService.isMacAppStore()
) {
await this.dialogService.openSimpleDialog({
title: { key: "browserIntegrationUnsupportedTitle" },
content: { key: "browserIntegrationMasOnlyDesc" },
acceptButtonText: { key: "ok" },
cancelButtonText: null,
type: "warning",
});
this.form.controls.enableBrowserIntegration.setValue(false);
return;
} else if (ipc.platform.isSnapStore || ipc.platform.isFlatpak) {
await this.dialogService.openSimpleDialog({
title: { key: "browserIntegrationUnsupportedTitle" },
content: { key: "browserIntegrationLinuxDesc" },
acceptButtonText: { key: "ok" },
cancelButtonText: null,
type: "warning",
});
this.form.controls.enableBrowserIntegration.setValue(false);
return;
}
this.form.controls.enableBrowserIntegration.setValue(false);
return;
if (ipc.platform.isWindowsStore) {
await this.dialogService.openSimpleDialog({
title: { key: "browserIntegrationUnsupportedTitle" },
content: { key: "browserIntegrationWindowsStoreDesc" },
acceptButtonText: { key: "ok" },
cancelButtonText: null,
type: "warning",
});
this.form.controls.enableBrowserIntegration.setValue(false);
return;
}
if (ipc.platform.isSnapStore || ipc.platform.isFlatpak) {
await this.dialogService.openSimpleDialog({
title: { key: "browserIntegrationUnsupportedTitle" },
content: { key: "browserIntegrationLinuxDesc" },
acceptButtonText: { key: "ok" },
cancelButtonText: null,
type: "warning",
});
this.form.controls.enableBrowserIntegration.setValue(false);
return;
}
}
await this.desktopSettingsService.setBrowserIntegrationEnabled(