mirror of
https://github.com/bitwarden/browser
synced 2025-12-19 17:53:39 +00:00
Close to tray (#21)
* Close to Tray implemented * Enable Tray Icon on Linux * Remove unnecessary function * Revert 26a3a98e384cc62a94f2b213af3a6543874b3d95
This commit is contained in:
@@ -68,6 +68,17 @@ export class TrayMain {
|
||||
});
|
||||
}
|
||||
|
||||
if (process.platform === 'win32') {
|
||||
this.windowMain.win.on('close', async (e: Event) => {
|
||||
if (await this.storageService.get<boolean>(ElectronConstants.enableCloseToTrayKey)) {
|
||||
if(!this.windowMain.isQuitting){
|
||||
e.preventDefault();
|
||||
this.hideToTray();
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
this.windowMain.win.on('show', async (e: Event) => {
|
||||
const enableTray = await this.storageService.get<boolean>(ElectronConstants.enableTrayKey);
|
||||
if (!enableTray) {
|
||||
@@ -124,6 +135,7 @@ export class TrayMain {
|
||||
}
|
||||
|
||||
private closeWindow() {
|
||||
this.windowMain.isQuitting = true;
|
||||
if (this.windowMain.win != null) {
|
||||
this.windowMain.win.close();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user