Skip to content

Commit

Permalink
Proper app exit
Browse files Browse the repository at this point in the history
  • Loading branch information
oliverschwendener committed Feb 9, 2018
1 parent 66e94d0 commit 3c55c1b
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions src/js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,7 @@ function startApp() {
mainWindow.loadURL(mainWindowHtml)
//mainWindow.webContents.openDevTools()

mainWindow.on('closed', () => {
globalShortcut.unregisterAll()
mainWindow = null
})
mainWindow.on('closed', quitApp)

mainWindow.on('blur', (event, arg) => {
if (mainWindow.isVisible())
Expand All @@ -69,9 +66,7 @@ function startApp() {
hideWindow()
})

ipcMain.on('close-main-window', () => {
app.quit()
})
ipcMain.on('close-main-window', quitApp)

ipcMain.on('reload-window', () => {
setWindowOptions()
Expand Down Expand Up @@ -140,6 +135,8 @@ function setAutostartSettings() {
}

function quitApp() {
globalShortcut.unregisterAll()
mainWindow = null
app.quit()
}

Expand Down

0 comments on commit 3c55c1b

Please sign in to comment.