aboutsummaryrefslogtreecommitdiff
path: root/src/utils.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/utils.js')
-rw-r--r--src/utils.js7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/utils.js b/src/utils.js
index 5be9cfe..fc62f01 100644
--- a/src/utils.js
+++ b/src/utils.js
@@ -31,7 +31,7 @@ if (fs.existsSync("viper.json")) {
settings = {...settings, ...JSON.parse(fs.readFileSync("viper.json", "utf8"))};
settings.zip = path.join(settings.gamepath + "/northstar.zip");
} else {
- console.log(lang("general.missinggamepath"));
+ console.log(lang("general.missingpath"));
}
function setpath(win) {
@@ -39,10 +39,15 @@ function setpath(win) {
settings.gamepath = cli.param("setpath");
} else {
dialog.showOpenDialog({properties: ["openDirectory"]}).then(res => {
+ if (res.canceled) {
+ ipcMain.emit("newpath", null, false);
+ return;
+ }
settings.gamepath = res.filePaths[0];
settings.zip = path.join(settings.gamepath + "/northstar.zip");
saveSettings();
win.webContents.send("newpath", settings.gamepath);
+ ipcMain.emit("newpath", null, settings.gamepath);
}).catch(err => {console.error(err)})
}