fix(beforeunload): Chrome 51 - return undefined to continue

This commit is contained in:
Ben Gotow 2016-06-03 16:09:18 -07:00
parent 1f27e00069
commit e147b59ad0

View file

@ -38,8 +38,10 @@ class WindowEventHandler
# Don't hide the window here if we don't want the renderer process to be
# throttled in case more work needs to be done before closing
# In Electron, returning false cancels the close.
return @runUnloadCallbacks()
# In Electron, returning any value other than undefined cancels the close.
canCloseWindow = @runUnloadCallbacks()
return undefined if canCloseWindow
return false
window.onunload = =>
NylasEnv.storeWindowDimensions()