From 66d56018f58ef249b1044606952f314d8beae73a Mon Sep 17 00:00:00 2001 From: Quentin Legot Date: Sat, 20 Aug 2022 11:53:13 +0200 Subject: [PATCH] Second hotfix --- package.json | 2 +- src/client/assets/js/checkingUpdate.js | 4 +--- src/server/main.js | 2 +- src/server/updater.js | 13 +++++++------ 4 files changed, 10 insertions(+), 11 deletions(-) diff --git a/package.json b/package.json index e47832d..8f3d3ae 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "altarik-launcher", "author": "Altarik", - "version": "1.2.1", + "version": "1.2.2", "description": "Altarik Launcher", "main": "src/server/main.js", "homepage": "https://altarik.fr/", diff --git a/src/client/assets/js/checkingUpdate.js b/src/client/assets/js/checkingUpdate.js index 5b5ebb1..a876c91 100644 --- a/src/client/assets/js/checkingUpdate.js +++ b/src/client/assets/js/checkingUpdate.js @@ -7,13 +7,11 @@ app = vue.createApp({ } }, mounted() { + this.sendCheckingUpdate() }, methods: { sendCheckingUpdate() { ipcRenderer.send("checking-update"); - }, - closeFullscreen () { - this.displayFullscreen = "none" } }, }); diff --git a/src/server/main.js b/src/server/main.js index 3f9d560..8f2ac01 100644 --- a/src/server/main.js +++ b/src/server/main.js @@ -2,7 +2,7 @@ const { app, BrowserWindow, Menu, ipcMain, autoUpdater, dialog } = require('elec const logger = require('electron-log') const { join } = require('path') const updater = require('./updater.js') -let updaterInstance = new updater.Updater(app, win, autoUpdater, dialog, logger, showNotification) +let updaterInstance = new updater.Updater(app, autoUpdater, dialog, logger, showNotification) updaterInstance.configUpdater() if (require('electron-squirrel-startup')) { diff --git a/src/server/updater.js b/src/server/updater.js index 523b6f6..de8e6fa 100644 --- a/src/server/updater.js +++ b/src/server/updater.js @@ -4,9 +4,8 @@ const server = 'https://update.electronjs.org' class Updater { - constructor(app, win, autoUpdater, dialog, logger, ipcMain) { + constructor(app, autoUpdater, dialog, logger, ipcMain) { this.app = app - this.win = win this.autoUpdater = autoUpdater this.dialog = dialog this.logger = logger @@ -21,13 +20,9 @@ class Updater { this.logger.info(`arch: ${process.arch}`) if(isDev) { this.logger.info(`developpement version ${this.app.getVersion()}`) - this.win.loadFile('src/client/login.html') return } this.logger.info(`production version ${this.app.getVersion()}`) - - const feed = `${server}/${pkg.repository}/${process.platform}-${process.arch}/${this.app.getVersion()}` - this.autoUpdater.setFeedURL(feed) // TODO : replace dialog by automatic restart this.autoUpdater.on('update-downloaded', (_event, releaseNotes, releaseName) => { @@ -39,7 +34,13 @@ class Updater { } checkForUpdates(win, showNotification) { + if(isDev) { + win.loadFile('src/client/login.html') + return; + } this.logger.info("Checking for update...") + const feed = `${server}/${pkg.repository}/${process.platform}-${process.arch}/${this.app.getVersion()}` + this.autoUpdater.setFeedURL(feed) this.autoUpdater.checkForUpdates() this.autoUpdater.on('error', message => { this.logger.error('There was a problem updating the application')