minimize event only on windows

This commit is contained in:
Kyle Spearrin 2018-05-08 10:29:51 -04:00
parent 9772acad40
commit 2c8e153931
2 changed files with 9 additions and 7 deletions

2
jslib

@ -1 +1 @@
Subproject commit 3270d8bd0ed46b62262575f5d59fca2414aaf8c7
Subproject commit e7779759f25d315d35b20ae85371ebe86fed3eef

View File

@ -53,12 +53,14 @@ export class TrayMain {
this.showTray();
}
this.windowMain.win.on('minimize', async (e: Event) => {
if (await this.storageService.get<boolean>(ElectronConstants.enableMinimizeToTrayKey)) {
e.preventDefault();
this.hideToTray();
}
});
if (process.platform === 'win32') {
this.windowMain.win.on('minimize', async (e: Event) => {
if (await this.storageService.get<boolean>(ElectronConstants.enableMinimizeToTrayKey)) {
e.preventDefault();
this.hideToTray();
}
});
}
this.windowMain.win.on('show', async (e: Event) => {
const enableTray = await this.storageService.get<boolean>(ElectronConstants.enableTrayKey);