aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-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);