Skip to content

Commit

Permalink
Merge pull request #321 from h3poteto/iss-319
Browse files Browse the repository at this point in the history
closes #319 Quit application when window is closed
  • Loading branch information
h3poteto authored May 19, 2018
2 parents ee196e9 + 27abebc commit b111551
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 b111551

Please sign in to comment.