From 18e8874bc10c190c69d41f5566aaa562b895f876 Mon Sep 17 00:00:00 2001 From: Vit Horacek <36083550+mountiny@users.noreply.github.com> Date: Wed, 12 Mar 2025 10:41:54 +0000 Subject: [PATCH] Revert "Fix desktop updates to install the latest one" --- desktop/main.ts | 31 ++----------------------------- 1 file changed, 2 insertions(+), 29 deletions(-) diff --git a/desktop/main.ts b/desktop/main.ts index 1c5b6cfcb8a0b..2b296d84f6a39 100644 --- a/desktop/main.ts +++ b/desktop/main.ts @@ -212,9 +212,6 @@ const showKeyboardShortcutsPage = (browserWindow: BrowserWindow) => { const electronUpdater = (browserWindow: BrowserWindow): PlatformSpecificUpdater => ({ init: () => { autoUpdater.on(ELECTRON_EVENTS.UPDATE_DOWNLOADED, (info) => { - // eslint-disable-next-line no-console - console.group('[dev] ELECTRON_EVENTS.UPDATE_DOWNLOADED'); - console.debug('[dev] info:', info); const systemMenu = Menu.getApplicationMenu(); const updateMenuItem = systemMenu?.getMenuItemById(`update`); const checkForUpdatesMenuItem = systemMenu?.getMenuItemById(`checkForUpdates`); @@ -230,39 +227,15 @@ const electronUpdater = (browserWindow: BrowserWindow): PlatformSpecificUpdater if (browserWindow.isVisible() && !isSilentUpdating) { browserWindow.webContents.send(ELECTRON_EVENTS.UPDATE_DOWNLOADED, info.version); } else { - console.debug('[dev] else'); - - autoUpdater - .checkForUpdates() - .then((result) => { - console.debug('[dev] result', result); - if (result?.updateInfo.version === downloadedVersion) { - console.debug('[dev] if - versions match, installing'); - quitAndInstallWithUpdate(); - } else { - console.debug('[dev] else - downloading new update'); - return autoUpdater.downloadUpdate().then(() => { - console.debug('[dev] download complete, installing'); - quitAndInstallWithUpdate(); - }); - } - }) - .catch((error) => { - console.debug('[dev] error', error); - log.error('Error during update check or download:', error); - }); + quitAndInstallWithUpdate(); } - // eslint-disable-next-line no-console - console.groupEnd(); }); ipcMain.on(ELECTRON_EVENTS.START_UPDATE, quitAndInstallWithUpdate); autoUpdater.checkForUpdates(); }, update: () => { - autoUpdater.checkForUpdates().then((result) => { - console.debug('[dev] update result', result); - }); + autoUpdater.checkForUpdates(); }, });