From 87e704123ff6d8d2bce173980e53d3d1ec94aa38 Mon Sep 17 00:00:00 2001 From: 0neGal Date: Sun, 17 Apr 2022 19:06:21 +0200 Subject: fixed issue causing viper not open the GUI I don't really understand why or how anything broke, all I know is this fixes it, and I don't know how to feel about this madness. --- src/utils.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/utils.js b/src/utils.js index 46b89a6..6a45bd7 100644 --- a/src/utils.js +++ b/src/utils.js @@ -184,10 +184,12 @@ async function setpath(win, forcedialog) { // merge it together with the already existing settings function saveSettings(obj = {}) { settings = {...settings, ...obj}; - fs.writeFileSync(app.getPath("appData") + "/viper.json", JSON.stringify({...settings, ...obj})); - if (! gamepathExists()) {return} - fs.writeFileSync(path.join(settings.gamepath, "ns_startup_args.txt"), settings.nsargs); + if (fs.existsSync(settings.gamepath)) { + fs.writeFileSync(path.join(settings.gamepath, "ns_startup_args.txt"), settings.nsargs); + } + + fs.writeFileSync(app.getPath("appData") + "/viper.json", JSON.stringify({...settings, ...obj})); } // Returns the current Northstar version -- cgit v1.2.3