From a4a3667f92cd01e110b3bd57eeca02dc565d6bbc Mon Sep 17 00:00:00 2001 From: Benjamin Staneck Date: Fri, 6 Dec 2024 21:06:53 +0100 Subject: [PATCH] fix minimize --- electron/main/index.ts | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/electron/main/index.ts b/electron/main/index.ts index 526dd21d0..8e8fa104f 100644 --- a/electron/main/index.ts +++ b/electron/main/index.ts @@ -140,12 +140,13 @@ async function createWindow() { mainWindow?.setMenu(null); - mainWindow?.on("minimize", (event: { preventDefault: () => void }) => { - event.preventDefault(); - mainWindow?.minimize(); + mainWindow?.on("minimize", () => { + if (mainWindow?.isMinimized()) { + mainWindow?.minimize(); - if (process.platform === "darwin") { - app.dock.hide(); + if (process.platform === "darwin") { + app.dock.hide(); + } } });