From 2c8e15393158679eff86e4dd8d1582bb43e46c5e Mon Sep 17 00:00:00 2001 From: Kyle Spearrin Date: Tue, 8 May 2018 10:29:51 -0400 Subject: [PATCH] minimize event only on windows --- jslib | 2 +- src/main/tray.main.ts | 14 ++++++++------ 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/jslib b/jslib index 3270d8bd0e..e7779759f2 160000 --- a/jslib +++ b/jslib @@ -1 +1 @@ -Subproject commit 3270d8bd0ed46b62262575f5d59fca2414aaf8c7 +Subproject commit e7779759f25d315d35b20ae85371ebe86fed3eef diff --git a/src/main/tray.main.ts b/src/main/tray.main.ts index b2ea03d716..e03bc61779 100644 --- a/src/main/tray.main.ts +++ b/src/main/tray.main.ts @@ -53,12 +53,14 @@ export class TrayMain { this.showTray(); } - this.windowMain.win.on('minimize', async (e: Event) => { - if (await this.storageService.get(ElectronConstants.enableMinimizeToTrayKey)) { - e.preventDefault(); - this.hideToTray(); - } - }); + if (process.platform === 'win32') { + this.windowMain.win.on('minimize', async (e: Event) => { + if (await this.storageService.get(ElectronConstants.enableMinimizeToTrayKey)) { + e.preventDefault(); + this.hideToTray(); + } + }); + } this.windowMain.win.on('show', async (e: Event) => { const enableTray = await this.storageService.get(ElectronConstants.enableTrayKey);