aboutsummaryrefslogtreecommitdiff
path: root/src/app
diff options
context:
space:
mode:
authorRemy Raes <raes.remy@gmail.com>2022-01-10 00:32:55 +0100
committerRemy Raes <raes.remy@gmail.com>2022-01-10 00:32:55 +0100
commit1a47d4b47b6a58b4a2b5c5834cf1bcb8c985352c (patch)
tree0eca1f12f851edb6a2b9b32863d5a0d02a76f3c6 /src/app
parentd582b1165bf090d320cec3a2d65ed04a5cc5e32b (diff)
downloadViper-1a47d4b47b6a58b4a2b5c5834cf1bcb8c985352c.tar.gz
Viper-1a47d4b47b6a58b4a2b5c5834cf1bcb8c985352c.zip
[feat] launch button install Northstar if it's not installed
Diffstat (limited to 'src/app')
-rw-r--r--src/app/main.js11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/app/main.js b/src/app/main.js
index 0c48db1..1fdaa00 100644
--- a/src/app/main.js
+++ b/src/app/main.js
@@ -3,6 +3,7 @@ const path = require("path");
const { ipcRenderer } = require("electron");
const lang = require("../lang");
+let shouldInstallNorthstar = false;
var settings = {
gamepath: "",
@@ -43,7 +44,14 @@ function setpath(value = false) {
ipcRenderer.send("setpath", value);
}
-function launch() {ipcRenderer.send("launch")}
+function launch() {
+ if (shouldInstallNorthstar) {
+ update();
+ shouldInstallNorthstar = false;
+ } else {
+ ipcRenderer.send("launch");
+ }
+}
function launchVanilla() {ipcRenderer.send("launchVanilla")}
function log(msg) {
@@ -153,6 +161,7 @@ ipcRenderer.on("version", (event, versions) => {
// Since Northstar is not installed, we cannot launch it
northstar.innerText = 'Install';
+ shouldInstallNorthstar = true;
}
}); ipcRenderer.send("getversion");