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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user