diff options
author | 0neGal <mail@0negal.com> | 2022-08-17 18:25:52 +0200 |
---|---|---|
committer | 0neGal <mail@0negal.com> | 2022-08-17 18:25:52 +0200 |
commit | 1da94c96948511b3b69f82b502265735c0c005e4 (patch) | |
tree | c4dd8d040a5e86cc18fbee4cc31c513f5f8666ac /src/app/main.js | |
parent | 19e3f0d2d44087036712dccf1b2b0b81b9df759a (diff) | |
parent | 5106d9ed409a3cc91a7755f961fab1bf91d8b7fb (diff) | |
download | Viper-1da94c96948511b3b69f82b502265735c0c005e4.tar.gz Viper-1da94c96948511b3b69f82b502265735c0c005e4.zip |
Merge branch 'main' of https://github.com/0neGal/viper
Diffstat (limited to 'src/app/main.js')
-rw-r--r-- | src/app/main.js | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/app/main.js b/src/app/main.js index 9fb3191..d6a57d6 100644 --- a/src/app/main.js +++ b/src/app/main.js @@ -1,6 +1,6 @@ const fs = require("fs"); const path = require("path"); -const { ipcRenderer, shell } = require("electron"); +const { ipcRenderer, shell, ipcMain } = require("electron"); const lang = require("../lang"); var modsobj = {}; @@ -62,6 +62,12 @@ if (fs.existsSync("viper.json")) { setpath(); } + +// Show a toast message if no Internet connection has been detected. +if (!navigator.onLine) { + ipcRenderer.send("no-internet"); +} + function exit() {ipcRenderer.send("exit")} function update() {ipcRenderer.send("update")} @@ -122,6 +128,7 @@ ipcRenderer.on("ns-update-event", (event, key) => { console.log(lang(key)); switch(key) { case "cli.update.uptodate.short": + case "cli.update.noInternet": setButtons(true); playNsBtn.innerText = lang("gui.launch"); break; |