Skip to content

Commit

Permalink
Quit app when window is closed. (#337)
Browse files Browse the repository at this point in the history
  • Loading branch information
robinjhuang authored Nov 24, 2024
1 parent 6671f4b commit 60cd8c2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 0 additions & 2 deletions src/main-process/appWindow.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,6 @@ export class AppWindow {
public onClose(callback: () => void): void {
this.window.on('close', () => {
callback();
// Currently, the application quits when the window is closed for all operating systems.
app.quit();
});
}

Expand Down
4 changes: 4 additions & 0 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,10 @@ if (!gotTheLock) {
log.debug('App ready');

const appWindow = new AppWindow();
appWindow.onClose(() => {
log.info('App window closed. Quitting application.');
app.quit();
});

// Register basic handlers that are necessary during app's installation.
new PathHandlers().registerHandlers();
Expand Down

0 comments on commit 60cd8c2

Please sign in to comment.