From 4dce627ee4c74c16c0e4cba3d974458da4d5700d Mon Sep 17 00:00:00 2001 From: 0neGal Date: Mon, 7 Aug 2023 23:26:51 +0200 Subject: fixed Northstar startup arguments not applying --- src/modules/settings.js | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/src/modules/settings.js b/src/modules/settings.js index 3b60d7f..3833e4f 100644 --- a/src/modules/settings.js +++ b/src/modules/settings.js @@ -70,11 +70,6 @@ settings.save = (obj = {}) => { delete settings_content.save; - // write Northstar's startup argument file - if (fs.existsSync(settings.gamepath)) { - fs.writeFileSync(path.join(settings.gamepath, "ns_startup_args.txt"), settings.nsargs); - } - let stringified_settings = JSON.stringify({ ...settings, ...obj }) @@ -83,6 +78,16 @@ settings.save = (obj = {}) => { // write the settings file fs.writeFileSync(settings_file, stringified_settings); + + // set the settings obj for the main process + settings = settings_content; + + // write Northstar's startup arguments file + if (fs.existsSync(settings.gamepath)) { + fs.writeFileSync(path.join( + settings.gamepath, "ns_startup_args.txt" + ), settings.nsargs); + } } module.exports = settings; -- cgit v1.2.3