Move event forwarding back to init

This commit is contained in:
Kevin Sawicki 2015-12-09 18:11:38 -08:00
parent 92433be888
commit fc724b51e8
2 changed files with 6 additions and 7 deletions

View file

@ -34,13 +34,6 @@ app.setAppPath = (path) ->
app.getAppPath = -> app.getAppPath = ->
appPath appPath
# Map process.exit to app.exit, which quits gracefully.
process.exit = app.exit
# Emit a process 'exit' event on app quit.
app.on 'quit', (event, exitCode) ->
process.emit 'exit', exitCode
# Routes the events to webContents. # Routes the events to webContents.
for name in ['login', 'certificate-error', 'select-client-certificate'] for name in ['login', 'certificate-error', 'select-client-certificate']
do (name) -> do (name) ->

View file

@ -51,7 +51,13 @@ process.on 'uncaughtException', (error) ->
message = "Uncaught Exception:\n#{stack}" message = "Uncaught Exception:\n#{stack}"
dialog.showErrorBox 'A JavaScript error occurred in the main process', message dialog.showErrorBox 'A JavaScript error occurred in the main process', message
# Emit a process 'exit' event on app quit.
{app} = require 'electron' {app} = require 'electron'
app.on 'quit', (event, exitCode) ->
process.emit 'exit', exitCode
# Map process.exit to app.exit, which quits gracefully.
process.exit = app.exit
# Load the RPC server. # Load the RPC server.
require './rpc-server' require './rpc-server'