1
0
mirror of https://github.com/bitwarden/desktop synced 2025-12-21 02:33:15 +00:00

Add support for "openAtLogin"

This commit is contained in:
Hinton
2020-11-25 20:43:29 +01:00
parent f926f80d8c
commit f512df309d
4 changed files with 25 additions and 13 deletions

View File

@@ -1,4 +1,4 @@
import { ipcMain } from 'electron';
import { app, ipcMain } from 'electron';
import { Main } from '../main';
@@ -15,6 +15,10 @@ export class MessagingMain {
init() {
this.scheduleNextSync();
if (process.platform !== 'linux') {
const loginSettings = app.getLoginItemSettings();
this.storageService.save(ElectronConstants.openAtLogin, loginSettings.openAtLogin);
}
ipcMain.on('messagingService', async (event: any, message: any) => this.onMessage(message));
}
@@ -44,9 +48,15 @@ export class MessagingMain {
case 'hideToTray':
this.main.trayMain.hideToTray();
break;
case 'addStartOnLogin':
case 'addOpenAtLogin':
if (process.platform !== 'linux') {
app.setLoginItemSettings({openAtLogin: true});
}
break;
case 'removeStartOnLogin':
case 'removeOpenAtLogin':
if (process.platform !== 'linux') {
app.setLoginItemSettings({openAtLogin: false});
}
break;
default:
break;