diff --git a/src/electron/tray.main.ts b/src/electron/tray.main.ts index 7645cf6af7..e7418e06d9 100644 --- a/src/electron/tray.main.ts +++ b/src/electron/tray.main.ts @@ -121,19 +121,19 @@ export class TrayMain { } private toggleWindow() { - if (this.windowMain.win === null) { + if (this.windowMain.win == null) { if (process.platform === 'darwin') { // On MacOS, closing the window via the red button destroys the BrowserWindow instance. this.windowMain.createWindow().then(() => { this.windowMain.win.show(); }); } + return; + } + if (this.windowMain.win.isVisible()) { + this.windowMain.win.hide(); } else { - if (this.windowMain.win.isVisible()) { - this.windowMain.win.hide(); - } else { - this.windowMain.win.show(); - } + this.windowMain.win.show(); } }