From a4b19310a64c7332c13817236debaf44bfa4e838 Mon Sep 17 00:00:00 2001 From: Ben Bartholomew <70723971+ben-bartholomew@users.noreply.github.com> Date: Wed, 14 Aug 2024 14:16:11 -0400 Subject: [PATCH] Modifying handleTrayClick to minimize when window is visible (#452) * Modifying handleTrayClick to minimize when window is visible. * Style matching --- src/helpers/trayManager.ts | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/helpers/trayManager.ts b/src/helpers/trayManager.ts index f9b849f4..5efd716a 100644 --- a/src/helpers/trayManager.ts +++ b/src/helpers/trayManager.ts @@ -149,7 +149,14 @@ export class TrayManager { private handleTrayClick() { const mainWindow = getMainWindow(); - mainWindow?.show(); + if (!mainWindow) + return; + + if (mainWindow.isVisible()) { + mainWindow.hide(); + } else { + mainWindow.show(); + } } private destroy(): void {