From ac77643fc403b1e449532134316f1e880fb91ea8 Mon Sep 17 00:00:00 2001 From: rafael-aero Date: Wed, 25 Aug 2021 09:10:27 +0200 Subject: [PATCH] add variable to control kill behaviour --- ElectronNET.Host/main.js | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/ElectronNET.Host/main.js b/ElectronNET.Host/main.js index cdb900c..5e74e52 100644 --- a/ElectronNET.Host/main.js +++ b/ElectronNET.Host/main.js @@ -101,7 +101,16 @@ app.on('ready', () => { app.on('quit', async (event, exitCode) => { await server.close(); - apiProcess.kill(); + + var shouldKill = true; + + if (manifestJsonFile.hasOwnProperty('killOnQuit')) { + shouldKill = manifestJsonFile.killOnQuit; + } + + if (shouldKill) { + apiProcess.kill(); + } }); function isSplashScreenEnabled() { @@ -141,7 +150,7 @@ function startSplashScreen() { if (manifestJsonFile.splashscreen.hasOwnProperty('timeout')) { var timeout = manifestJsonFile.splashscreen.timeout; setTimeout((t) => { - if (splashScreen != null ) { + if (splashScreen) { splashScreen.hide(); } }, timeout);