From 048ac6a214974f8a6fd1fc8383aef3376f7cc5f2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Enrique=20Rami=CC=81rez?= Date: Fri, 27 Nov 2015 17:05:33 -0600 Subject: [PATCH] Removing deprecated 'activate-with-no-open-windows' event As mentioned on this Electron's issue: https://github.com/atom/electron/pull/2777 The 'activate-with-open-windows' event has been deprecated in favor of a global 'activate' event with a 'hasVisibleWindows' parameter. This fixes Nylas from crashing when closing the main window and opening via clicking the Dock icon. --- src/browser/application.coffee | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/browser/application.coffee b/src/browser/application.coffee index 793d86111..e9ff529c4 100644 --- a/src/browser/application.coffee +++ b/src/browser/application.coffee @@ -341,8 +341,9 @@ class Application # win = BrowserWindow.fromWebContents(event.sender) event.sender.send('inline-styles-result', {body, clientId}) - app.on 'activate-with-no-open-windows', (event) => - @openWindowsForTokenState() + app.on 'activate', (event, hasVisibleWindows) => + if not hasVisibleWindows + @openWindowsForTokenState() event.preventDefault() ipcMain.on 'update-application-menu', (event, template, keystrokesByCommand) =>