Skip to content

Commit

Permalink
Merge branch 'main' into patch-1
Browse files Browse the repository at this point in the history
  • Loading branch information
sircharlo authored Oct 10, 2023
2 parents 9c35244 + ffc976d commit 5199d20
Show file tree
Hide file tree
Showing 5 changed files with 985 additions and 1,058 deletions.
17 changes: 17 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"cSpell.words": [
"ABCDEFGHIJKLOMNOPQRSTUVWXYZ",
"confno",
"deeporange",
"firstfile",
"fontawesome",
"fortawesome",
"inputmask",
"NSIS",
"popperjs",
"prefs",
"sircharlo",
"timeframe",
"zoommtg"
]
}
6 changes: 3 additions & 3 deletions launcher.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const axios = require("axios"),
const axios = require('axios').default,
net = require("net"),
remote = require("@electron/remote"),
fs = require("graceful-fs"),
Expand All @@ -8,13 +8,13 @@ const axios = require("axios"),
{shell} = require("electron"),
$ = require("jquery");
const appPath = remote.app.getPath("userData"),
// green pink blue deeporange purple yellow cyen brown
// green pink blue deeporange purple yellow cyan brown
colors = ["#00e676", "#ff80ab", "#64b5f6", "#ffb74d", "#ea80fc", "#ffff8d", "#18ffff", "#bcaaa4"],
prefsFile = path.join(appPath, "prefs.json");
var scheduledActionInfo = {},
broadcastStrings = {},
prefs = {};
axios.defaults.adapter = require("axios/lib/adapters/http");
axios.defaults.adapter = "http";
function checkInternet(online) {
if (online) {
$("#overlayInternetCheck").fadeIn("fast", () => {
Expand Down
28 changes: 16 additions & 12 deletions main.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
const {
app,
BrowserWindow,
ipcMain
} = require("electron"), {
autoUpdater
} = require("electron-updater"),
const { app, BrowserWindow, ipcMain } = require("electron"),
{ autoUpdater } = require("electron-updater"),
os = require("os"),
remote = require("@electron/remote/main");
var win = {};
Expand All @@ -13,13 +8,13 @@ function createUpdateWindow() {
win = new BrowserWindow({
webPreferences: {
nodeIntegration: true,
contextIsolation: false
contextIsolation: false,
},
minWidth: 1366,
minHeight: 768,
fullscreen: true,
// alwaysOnTop: true,
title: "JW Launcher"
title: "JW Launcher",
});
const ses = win.webContents.session;
ses.clearCache();
Expand All @@ -28,7 +23,9 @@ function createUpdateWindow() {
win.setMenuBarVisibility(false);
win.loadFile("index.html");
win.maximize();
win.on("show", () => { win.focus(); });
win.on("show", () => {
win.focus();
});
win.show();
}
const gotTheLock = app.requestSingleInstanceLock();
Expand All @@ -43,7 +40,11 @@ if (!gotTheLock) {
});
ipcMain.on("autoUpdate", () => {
win.webContents.send("hideThenShow", ["InternetCheck", "UpdateCheck"]);
autoUpdater.checkForUpdates();
autoUpdater.checkForUpdates().then((result) => {
if (!result) {
win.webContents.send("goAhead");
}
});
});
autoUpdater.on("error", () => {
win.webContents.send("goAhead");
Expand All @@ -64,7 +65,10 @@ if (!gotTheLock) {
win.webContents.send("updateDownloadProgress", [prog.percent]);
});
autoUpdater.on("update-downloaded", () => {
win.webContents.send("hideThenShow", ["UpdateAvailable", "UpdateDownloaded"]);
win.webContents.send("hideThenShow", [
"UpdateAvailable",
"UpdateDownloaded",
]);
setImmediate(() => {
autoUpdater.quitAndInstall();
});
Expand Down
Loading

0 comments on commit 5199d20

Please sign in to comment.