diff options
author | Remy Raes <raes.remy@gmail.com> | 2022-01-10 00:32:55 +0100 |
---|---|---|
committer | Remy Raes <raes.remy@gmail.com> | 2022-01-10 00:32:55 +0100 |
commit | 1a47d4b47b6a58b4a2b5c5834cf1bcb8c985352c (patch) | |
tree | 0eca1f12f851edb6a2b9b32863d5a0d02a76f3c6 /src | |
parent | d582b1165bf090d320cec3a2d65ed04a5cc5e32b (diff) | |
download | Viper-1a47d4b47b6a58b4a2b5c5834cf1bcb8c985352c.tar.gz Viper-1a47d4b47b6a58b4a2b5c5834cf1bcb8c985352c.zip |
[feat] launch button install Northstar if it's not installed
Diffstat (limited to 'src')
-rw-r--r-- | src/app/main.js | 11 |
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"); |