From a11a5390de56d8bb018effe39bd03e718e6028ef Mon Sep 17 00:00:00 2001 From: Wouter Jansen Date: Thu, 13 Jan 2022 15:45:15 +0100 Subject: [PATCH] Fixed closing app not always closing all threads --- app/cancel.js | 4 ---- app/download.js | 1 - app/folder_select.js | 2 -- app/main.js | 5 +++++ app/remove.js | 2 -- 5 files changed, 5 insertions(+), 9 deletions(-) diff --git a/app/cancel.js b/app/cancel.js index 1498058..6220e7d 100644 --- a/app/cancel.js +++ b/app/cancel.js @@ -27,7 +27,6 @@ $(() => { } function onCloseButtonPress() { - app.quit(); win.close(); } @@ -45,9 +44,7 @@ $(() => { } function onCancelButtonPress() { - app.quit(); win.close(); - } function onCancelAndRemoveButtonPress() { @@ -58,7 +55,6 @@ $(() => { console.log(err) } fs.unlinkSync(configPath); - app.quit(); win.close(); } diff --git a/app/download.js b/app/download.js index 1e0b17d..e91d519 100644 --- a/app/download.js +++ b/app/download.js @@ -89,7 +89,6 @@ $(() => { } function onCloseButtonPress() { - app.quit(); win.close(); } diff --git a/app/folder_select.js b/app/folder_select.js index 45f08be..471cafb 100644 --- a/app/folder_select.js +++ b/app/folder_select.js @@ -66,9 +66,7 @@ $(() => { } function onCloseButtonPress() { - app.quit(); win.close(); - } function onContinueButtonPress() { diff --git a/app/main.js b/app/main.js index 97dbb59..f79c0eb 100644 --- a/app/main.js +++ b/app/main.js @@ -43,6 +43,11 @@ function createWindow() { } +// Quit when all windows are closed. +app.on('window-all-closed', function() { + app.quit(); +}) + app.setAppUserModelId("PRBF2-Download-Assistant"); app.on('ready', createWindow); diff --git a/app/remove.js b/app/remove.js index 259656a..3a9237a 100644 --- a/app/remove.js +++ b/app/remove.js @@ -27,7 +27,6 @@ $(() => { } function onCloseButtonPress() { - app.quit(); win.close(); } @@ -52,7 +51,6 @@ $(() => { console.log(err) } fs.unlinkSync(configPath); - app.quit(); win.close(); }