From 26034ec3475a61682a17c95cb2bffdbc9e52af54 Mon Sep 17 00:00:00 2001 From: Alystrasz Date: Sat, 6 Aug 2022 23:13:24 +0200 Subject: feat: display a toast message if no Internet at launch --- src/app/main.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/app/main.js') diff --git a/src/app/main.js b/src/app/main.js index 4288d1d..163c63d 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,11 @@ 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")} -- cgit v1.2.3