aboutsummaryrefslogtreecommitdiff
path: root/src/index.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/index.js')
-rw-r--r--src/index.js9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/index.js b/src/index.js
index 09aa626..1b594ad 100644
--- a/src/index.js
+++ b/src/index.js
@@ -77,7 +77,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();
}
@@ -87,6 +87,7 @@ ipcMain.on("newpath", (event, newpath) => {
if (newpath === false && !win.isVisible()) {
win.webContents.send("nopathselected");
} else {
+ _sendVersionsInfo();
if (!win.isVisible()) {
win.show();
}
@@ -95,12 +96,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);