Skip to content

Commit

Permalink
fix(app-shell-odd): quit the app when the render process is killed. (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
vegano1 authored Jun 26, 2024
1 parent abf7f02 commit ce86430
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions app-shell-odd/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,8 @@ let rendererLogger: Logger
app.prependOnceListener('ready', startUp)
if (config.devtools) app.once('ready', installDevtools)

app.once('window-all-closed', () => {
log.debug('all windows closed, quitting the app')
function quitApplication(): void {
app.quit()
closeBrokerConnection()
.then(() => {
app.quit()
Expand All @@ -71,6 +71,16 @@ app.once('window-all-closed', () => {
log.warn('Failed to properly close MQTT connections:', error)
app.quit()
})
}

app.once('window-all-closed', () => {
log.debug('all windows closed, quitting the app')
quitApplication()
})

app.once('render-process-gone', (_, __, details) => {
log.error('Renderer process has died, quitting the app', details)
quitApplication()
})

function startUp(): void {
Expand Down

0 comments on commit ce86430

Please sign in to comment.