From bfa970d706e5d2a7bf3e5cbcefead1c2cb751fe8 Mon Sep 17 00:00:00 2001 From: talksik Date: Sun, 12 Apr 2026 10:22:21 -0700 Subject: [PATCH] fix: simplify window / app close behavior Closes #142 --- js/src/main.ts | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/js/src/main.ts b/js/src/main.ts index 51256a5..0ee644b 100644 --- a/js/src/main.ts +++ b/js/src/main.ts @@ -51,6 +51,7 @@ const createWindow = () => { mainWindow.on('closed', () => { mainWindow = null; + app.quit(); }); }; @@ -419,20 +420,16 @@ app.on('ready', () => { createAutoplayWindow(); }); -// Quit when all windows are closed, except on macOS. There, it's common -// for applications and their menu bar to stay active until the user quits -// explicitly with Cmd + Q. app.on('window-all-closed', () => { - if (process.platform !== 'darwin') { - app.quit(); - } + app.quit(); }); app.on('activate', () => { - // On OS X it's common to re-create a window in the app when the - // dock icon is clicked and there are no other windows open. - if (BrowserWindow.getAllWindows().length === 0) { + if (!mainWindow) { createWindow(); + } else { + mainWindow.show(); + mainWindow.focus(); } });