Changeset View
Changeset View
Standalone View
Standalone View
desktop/src/auto-update.js
Show All 18 Lines | export function initAutoUpdate(): void { | ||||
autoUpdater.on('update-not-available', scheduleCheckForUpdates); | autoUpdater.on('update-not-available', scheduleCheckForUpdates); | ||||
autoUpdater.on('update-downloaded', (event, releaseNotes, releaseName) => { | autoUpdater.on('update-downloaded', (event, releaseNotes, releaseName) => { | ||||
autoUpdater.setFeedURL({ url: getUpdateUrl(releaseName) }); | autoUpdater.setFeedURL({ url: getUpdateUrl(releaseName) }); | ||||
scheduleCheckForUpdates(); | scheduleCheckForUpdates(); | ||||
}); | }); | ||||
autoUpdater.on('error', error => { | |||||
console.error(error); | |||||
scheduleCheckForUpdates(); | |||||
kamil: Docs says: "Emitted when there is an error while updating."
I am not sure what exactly can… | |||||
}); | |||||
ipcMain.on('update-to-new-version', () => autoUpdater.quitAndInstall()); | ipcMain.on('update-to-new-version', () => autoUpdater.quitAndInstall()); | ||||
} | } |
Docs says: "Emitted when there is an error while updating."
I am not sure what exactly can cause an error but are we confident that this callback will be called only after checkForUpdates() failure and we that don't need to clear timeout?
I am afraid of causing an update twice when an error was thrown from a different reason than checkForUpdates failure.