Skip to content

Commit

Permalink
fix(electron): quit entire app if main window is closed
Browse files Browse the repository at this point in the history
  • Loading branch information
Harjot1Singh committed Nov 9, 2019
1 parent 859aefd commit 0868243
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions app/electron/electron-wrapper.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,23 +34,17 @@ function createWindow() {
mainWindow.focus()
} )

// Quit when main window is closed
mainWindow.on( 'closed', () => {
// Dereference the window object, usually you would store windows
// in an array if your app supports multi windows, this is the time
// when you should delete the corresponding element.
mainWindow = null
app.quit()
} )
}

app.on( 'ready', createWindow )

// Quit when all windows are closed.
app.on( 'window-all-closed', () => app.quit() )

app.on( 'activate', () => {
if ( mainWindow === null ) {
createWindow()
}
if ( mainWindow === null ) createWindow()
} )

// Catch any errors
Expand Down

0 comments on commit 0868243

Please sign in to comment.