aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlystrasz <contact@remyraes.com>2022-01-08 16:09:53 +0100
committerAlystrasz <contact@remyraes.com>2022-01-08 17:47:14 +0100
commitf6f940a976702a8dfb97cb2f53754faf774ad2cc (patch)
tree756032f316e242caf9fb3017f1e262173ec47a57
parent5206e9e4051b5c90e11b3aa331b0f6ee5546d25e (diff)
downloadViper-f6f940a976702a8dfb97cb2f53754faf774ad2cc.tar.gz
Viper-f6f940a976702a8dfb97cb2f53754faf774ad2cc.zip
[fix] displaying northstar version on first launch
Previously, on first viper launch, northstar version was parsed even before game path was selected, leading to "unknown" being systematically displayed on first launch. Now, when a game path is set, versions are automatically updated.
-rw-r--r--src/index.js9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/index.js b/src/index.js
index 53781dd..e421fd1 100644
--- a/src/index.js
+++ b/src/index.js
@@ -59,7 +59,7 @@ ipcMain.on("update", (event) => {utils.update()})
ipcMain.on("setpathcli", (event) => {utils.setpath()});
ipcMain.on("setpath", (event, value) => {
if (!value) {
- utils.setpath(win)
+ utils.setpath(win);
} else if (!win.isVisible()) {
win.show();
}
@@ -68,6 +68,7 @@ ipcMain.on("newpath", (event, newpath) => {
if (newpath === false && !win.isVisible()) {
win.webContents.send("nopathselected");
} else {
+ _sendVersionsInfo();
if (!win.isVisible()) {
win.show();
}
@@ -76,12 +77,14 @@ ipcMain.on("newpath", (event, newpath) => {
win.webContents.send("wrongpath");
});
-ipcMain.on("getversion", () => {
+function _sendVersionsInfo() {
win.webContents.send("version", {
ns: utils.getNSVersion(),
vp: "v" + require("../package.json").version
});
-});
+}
+
+ipcMain.on("getversion", () => _sendVersionsInfo());
ipcMain.on("versioncli", () => {
console.log("Viper: v" + require("../package.json").version);