aboutsummaryrefslogtreecommitdiff
path: root/src/index.js
diff options
context:
space:
mode:
author0neGal <mail@0negal.com>2024-02-03 19:15:29 +0100
committer0neGal <mail@0negal.com>2024-02-03 19:21:23 +0100
commit159e2f981bdbfd6a0589639424155d34b7a4cc91 (patch)
treeb3c1dfa3aaeb989b88abea6c9fc927c5dad3c2f9 /src/index.js
parent647bd1f6a76c834b3db9b70005f4b8365d1ded91 (diff)
downloadViper-159e2f981bdbfd6a0589639424155d34b7a4cc91.tar.gz
Viper-159e2f981bdbfd6a0589639424155d34b7a4cc91.zip
src/modules/settings.js now provides a function
This fixes a couple issues where the main process wouldn't actually get changes made to the settings, this fixes that. On top of this, changing settings is now done with `settings.set()` There shouldn't be any breakage from this change, but I suppose it is possible. Especially because the `settings()` function still does contain backup options set, meaning `settings.nsargs` is technically still valid, but dont expect it to actually be updated when that variable is changed, its merely here to avoid any problems.
Diffstat (limited to 'src/index.js')
-rw-r--r--src/index.js12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/index.js b/src/index.js
index 74fe669..82805d1 100644
--- a/src/index.js
+++ b/src/index.js
@@ -74,7 +74,7 @@ function start() {
}; send = win.send;
ipcMain.on("exit", () => {
- if (settings.originkill) {
+ if (settings().originkill) {
is_running.origin().then((running) => {
if (running) {
kill.origin().then(process.exit(0))
@@ -111,7 +111,7 @@ function start() {
ipcMain.on("delete-install-cache", () => {
let delete_dirs = [
path.join(app.getPath("cache"), "vipertmp"),
- path.join(settings.gamepath, "northstar.zip")
+ path.join(settings().gamepath, "northstar.zip")
]
for (let i = 0; i < delete_dirs.length; i++) {
@@ -197,7 +197,7 @@ function start() {
});
ipcMain.on("save-settings", (event, obj) => {
- settings.save(obj, false)
+ settings().save(obj, false);
});
ipcMain.on("saved-settings", (event, obj) => {
@@ -219,7 +219,7 @@ function start() {
})
// start auto-update process
- if (settings.autoupdate) {
+ if (settings().autoupdate) {
if (cli.hasParam("no-vp-updates")) {
update.northstar_autoupdate();
} else {
@@ -265,8 +265,8 @@ ipcMain.on("launch-ns", () => {launch()});
ipcMain.on("launch-vanilla", () => {launch("vanilla")});
ipcMain.on("setlang", (event, lang) => {
- settings.lang = lang;
- settings.save();
+ settings().set("lang", lang);
+ settings().save();
});
ipcMain.on("update-northstar", async (e, force_install) => {