Merge pull request #321 from h3poteto/iss-319
closes #319 Quit application when window is closed
This commit is contained in:
commit
b111551a07
|
@ -229,29 +229,13 @@ app.commandLine.appendSwitch('disable-renderer-backgrounding')
|
||||||
|
|
||||||
app.on('ready', createWindow)
|
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', () => {
|
app.on('window-all-closed', () => {
|
||||||
if (userStreaming !== null) {
|
app.quit()
|
||||||
userStreaming.stop()
|
// This is a single-window application.
|
||||||
userStreaming = null
|
// So quit application when main window is closed.
|
||||||
}
|
// if (process.platform !== 'darwin') {
|
||||||
if (localStreaming !== null) {
|
// app.quit()
|
||||||
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.on('activate', () => {
|
app.on('activate', () => {
|
||||||
|
|
Loading…
Reference in New Issue