From f169ffdaca72676741da92b728c88804ac278849 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Naz=C4=B1m=20Gediz=20Ayd=C4=B1ndo=C4=9Fmu=C5=9F?= Date: Tue, 14 Feb 2023 16:18:47 +0300 Subject: [PATCH] Update main.js Add window reopen procedure for macos --- main.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/main.js b/main.js index 29ae36f..58903f1 100644 --- a/main.js +++ b/main.js @@ -14,6 +14,11 @@ const createWindow = () => { // Call window instantiating function when the app is ready app.whenReady().then(() => { createWindow() + + // Open a window if none are open (macos only) + app.on('activate', () => { + if (BrowserWindow.getAllWindows().length === 0) createWindow() + }) }) // Quit the app when all windows are closed (for windows and linux only)