From 64ab1bb1119dd837571c28087b9782c90f577848 Mon Sep 17 00:00:00 2001 From: "SPRINX0\\prochazka" Date: Tue, 10 Sep 2024 08:41:03 +0200 Subject: [PATCH] autoupgrade status --- app/src/electron.js | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/app/src/electron.js b/app/src/electron.js index 2849b25e..cdaee3d4 100644 --- a/app/src/electron.js +++ b/app/src/electron.js @@ -287,6 +287,10 @@ ipcMain.handle('openExternal', async (event, url) => { }); ipcMain.handle('downloadUpdate', async (event, url) => { autoUpdater.downloadUpdate(); + changeAppUpdateStatus({ + icon: 'icon loading', + message: `Downloading update...`, + }); }); ipcMain.on('applyUpdate', async (event, url) => { autoUpdater.quitAndInstall(false, true); @@ -473,12 +477,17 @@ autoUpdater.on('checking-for-update', () => { autoUpdater.on('update-available', info => { console.log('Update available', info); - changeAppUpdateStatus({ - icon: 'icon download', - message: `New version ${info.version} available`, - }); - if (!autoUpdater.autoDownload) { + if (autoUpdater.autoDownload) { + changeAppUpdateStatus({ + icon: 'icon loading', + message: `Downloading update...`, + }); + } else { mainWindow.webContents.send('update-available', info.version); + changeAppUpdateStatus({ + icon: 'icon download', + message: `New version ${info.version} available`, + }); } });