From 9a20a0c71e6b0c757dd38b28569319f571eac740 Mon Sep 17 00:00:00 2001 From: "Grigorii K. Shartsev" Date: Thu, 14 Nov 2024 13:41:31 +0100 Subject: [PATCH] fix(mac): don't keep app running on Welcome/Login window close Signed-off-by: Grigorii K. Shartsev --- src/main.js | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/src/main.js b/src/main.js index 7d83aea1..fb3673aa 100644 --- a/src/main.js +++ b/src/main.js @@ -341,20 +341,20 @@ app.whenReady().then(async () => { mainWindow.once('ready-to-show', () => mainWindow.show()) } }) -}) - -app.on('window-all-closed', () => { - // Recreating a window - keep app running - if (isInWindowRelaunch) { - return - } - // On macOS, it is common for applications and their menu bar to stay active even without windows - // until the user quits explicitly with Cmd + Q or Quit from the menu. - if (isMac()) { - return - } + app.on('window-all-closed', () => { + // Recreating a window - keep app running + if (isInWindowRelaunch) { + return + } + // On macOS, it is common for applications and their menu bar to stay active even without windows + // until the user quits explicitly with Cmd + Q or Quit from the menu. + // However, it makes sense only for the Talk window and not for Authentication or Welcome windows. + if (isMac() && createMainWindow === createTalkWindow) { + return + } + // All the windows are closed - quit the app + app.quit() + }) - // All the windows are closed - quit the app - app.quit() })