Quick change to move allowDowngrade with the other updater option

This commit is contained in:
Pierre Jacquier
2025-05-12 16:21:22 -04:00
parent 1c4e3da07c
commit e82bb4dc39

View File

@ -446,9 +446,6 @@ export function getAutoUpdater(): AppUpdater {
// Using destructuring to access autoUpdater due to the CommonJS module of 'electron-updater'.
// It is a workaround for ESM compatibility issues, see https://github.com/electron-userland/electron-builder/issues/7976.
const { autoUpdater } = electronUpdater
// Allows us to rollback to a previous version if needed.
// See https://github.com/electron-userland/electron-builder/blob/7dbc6c77c340c869d1e7effa22135fc740003a0f/packages/electron-updater/src/AppUpdater.ts#L450-L451
autoUpdater.allowDowngrade = true
return autoUpdater
}
@ -462,6 +459,9 @@ app.on('ready', () => {
// TODO: we're getting `Error: Response ends without calling any handlers` with our setup,
// so at the moment this isn't worth enabling
autoUpdater.disableDifferentialDownload = true
// Allows us to rollback to a previous version if needed.
// See https://github.com/electron-userland/electron-builder/blob/7dbc6c77c340c869d1e7effa22135fc740003a0f/packages/electron-updater/src/AppUpdater.ts#L450-L451
autoUpdater.allowDowngrade = true
setTimeout(() => {
autoUpdater.checkForUpdates().catch(reportRejection)
}, 1000)