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.
This commit is contained in:
Enrique Ramírez 2015-11-27 17:05:33 -06:00
parent a69dad52a3
commit 8784350787

View file

@ -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) =>