diff --git a/desktop/src/auto-update.js b/desktop/src/auto-update.js index 2cef10bbd..b15fc52c9 100644 --- a/desktop/src/auto-update.js +++ b/desktop/src/auto-update.js @@ -1,39 +1,34 @@ // @flow // eslint-disable-next-line import/extensions import { app, ipcMain, autoUpdater } from 'electron/main'; const getUpdateUrl = version => `https://electron-update.commtechnologies.org/update/${process.platform}/${version}`; export function initAutoUpdate(): void { autoUpdater.setFeedURL({ url: getUpdateUrl(app.getVersion()) }); // Check for new updates every 10 minutes const updateIntervalMs = 10 * 60_000; let currentTimeout = null; const scheduleCheckForUpdates = () => { if (!currentTimeout) { currentTimeout = setTimeout(() => { currentTimeout = null; autoUpdater.checkForUpdates(); }, updateIntervalMs); } }; scheduleCheckForUpdates(); autoUpdater.on('update-not-available', scheduleCheckForUpdates); - autoUpdater.on('update-downloaded', (event, releaseNotes, releaseName) => { - autoUpdater.setFeedURL({ url: getUpdateUrl(releaseName) }); - scheduleCheckForUpdates(); - }); - autoUpdater.on('error', error => { console.error(error); scheduleCheckForUpdates(); }); ipcMain.on('update-to-new-version', () => autoUpdater.quitAndInstall()); }