Skip to content

Commit

Permalink
refs #319 Quit application when window is closed
Browse files Browse the repository at this point in the history
  • Loading branch information
h3poteto committed May 19, 2018
1 parent ee196e9 commit 27abebc
Showing 1 changed file with 6 additions and 22 deletions.
28 changes: 6 additions & 22 deletions src/main/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -229,29 +229,13 @@ app.commandLine.appendSwitch('disable-renderer-backgrounding')

app.on('ready', createWindow)

// In macOS, this method is called when user click x button.
// When this time, streaming must stop.
// https://github.com/electron/electron/blob/master/docs/api/app.md#event-window-all-closed
app.on('window-all-closed', () => {
if (userStreaming !== null) {
userStreaming.stop()
userStreaming = null
}
if (localStreaming !== null) {
localStreaming.stop()
localStreaming = null
}
if (publicStreaming !== null) {
publicStreaming.stop()
publicStreaming = null
}
if (listStreaming !== null) {
listStreaming.stop()
listStreaming = null
}
if (process.platform !== 'darwin') {
app.quit()
}
app.quit()
// This is a single-window application.
// So quit application when main window is closed.
// if (process.platform !== 'darwin') {
// app.quit()
// }
})

app.on('activate', () => {
Expand Down

0 comments on commit 27abebc

Please sign in to comment.