From ccde5e88da1e30e7910cb59c957451d077f3cd8f Mon Sep 17 00:00:00 2001 From: Carlos Alcaide Corvo Date: Fri, 29 Apr 2022 09:03:40 -0700 Subject: [PATCH] =?UTF-8?q?fix:=20=F0=9F=90=9B=20Mac=20os=20window=20lifec?= =?UTF-8?q?ycle=20(#1067)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ui/desktop/electron-app/src/index.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/ui/desktop/electron-app/src/index.js b/ui/desktop/electron-app/src/index.js index 24dd6d805..4bcbb9f70 100644 --- a/ui/desktop/electron-app/src/index.js +++ b/ui/desktop/electron-app/src/index.js @@ -222,6 +222,18 @@ app.on('ready', async () => { // Check for updates on launch appUpdater.run({ suppressNoUpdatePrompt: true }); + + /** + * Need for Mac OS behaviour of closing the window but not the app. + * This allows to reopen the window if the user clicks Boundary icon in the dock + * while the app is not close. + * More info: https://www.electronjs.org/docs/latest/tutorial/quick-start#open-a-window-if-none-are-open-macos + */ + app.on('activate', () => { + if (BrowserWindow.getAllWindows().length === 0) { + mainWindow = createWindow(partition, closeWindowCB); + } + }); }); /**