1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-06 00:13:28 +00:00

Fix flatpak autostart disabling (#14920)

This commit is contained in:
Bernd Schoolmann
2025-05-29 20:48:03 +02:00
committed by GitHub
parent 058eb9a04b
commit 8966b4fb50

View File

@@ -10,7 +10,7 @@ import { autostart } from "@bitwarden/desktop-napi";
import { Main } from "../main";
import { DesktopSettingsService } from "../platform/services/desktop-settings.service";
import { isFlatpak } from "../utils";
import { isFlatpak, isLinux, isSnapStore } from "../utils";
import { MenuUpdateRequest } from "./menu/menu.updater";
@@ -26,8 +26,11 @@ export class MessagingMain {
async init() {
this.scheduleNextSync();
if (process.platform === "linux") {
await this.desktopSettingsService.setOpenAtLogin(fs.existsSync(this.linuxStartupFile()));
if (isLinux()) {
// Flatpak and snap don't have access to or use the startup file. On flatpak, the autostart portal is used
if (!isFlatpak() && !isSnapStore()) {
await this.desktopSettingsService.setOpenAtLogin(fs.existsSync(this.linuxStartupFile()));
}
} else {
const loginSettings = app.getLoginItemSettings();
await this.desktopSettingsService.setOpenAtLogin(loginSettings.openAtLogin);