From cf4d8c463461f2d3cfa6ee57da75b726085a4d24 Mon Sep 17 00:00:00 2001 From: Alexander Zinchuk Date: Fri, 12 Jan 2024 13:00:12 +0100 Subject: [PATCH] Fix multiple auto-updates in Electron (#4148) --- src/electron/autoUpdates.ts | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/electron/autoUpdates.ts b/src/electron/autoUpdates.ts index 468535b39..8ccfaacbb 100644 --- a/src/electron/autoUpdates.ts +++ b/src/electron/autoUpdates.ts @@ -64,13 +64,11 @@ async function checkForUpdates(): Promise { if (await shouldPerformAutoUpdate()) { if (getIsAutoUpdateEnabled()) { autoUpdater.checkForUpdates(); - - return; + } else { + BrowserWindow.getAllWindows().forEach((window) => { + window.webContents.send(ElectronEvent.UPDATE_AVAILABLE); + }); } - - BrowserWindow.getAllWindows().forEach((window) => { - window.webContents.send(ElectronEvent.UPDATE_AVAILABLE); - }); } await pause(CHECK_UPDATE_INTERVAL);