aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
author0neGal <mail@0negal.com>2022-04-17 19:06:21 +0200
committer0neGal <mail@0negal.com>2022-04-17 19:06:21 +0200
commit87e704123ff6d8d2bce173980e53d3d1ec94aa38 (patch)
treee86fbc705b673931803071c9bc4746e66500cf7f /src
parentb4226cf152fa4ac35f7fe19a06a307ad026068c7 (diff)
downloadViper-87e704123ff6d8d2bce173980e53d3d1ec94aa38.tar.gz
Viper-87e704123ff6d8d2bce173980e53d3d1ec94aa38.zip
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.
Diffstat (limited to 'src')
-rw-r--r--src/utils.js8
1 files 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