Merge pull request #3711 from balena-io/fix-auto-update

patch: Fix auto update
This commit is contained in:
bulldozer-balena[bot] 2022-02-22 09:23:16 +00:00 committed by GitHub
commit f6aeb52b16
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -43,7 +43,7 @@ async function checkForUpdates(interval: number) {
const release = await autoUpdater.checkForUpdates(); const release = await autoUpdater.checkForUpdates();
const isOutdated = const isOutdated =
semver.compare(release.updateInfo.version, version) > 0; semver.compare(release.updateInfo.version, version) > 0;
const shouldUpdate = release.updateInfo.stagingPercentage || 0 > 0; const shouldUpdate = release.updateInfo.stagingPercentage !== 0; // undefinded (default) means 100%
if (shouldUpdate && isOutdated) { if (shouldUpdate && isOutdated) {
await autoUpdater.downloadUpdate(); await autoUpdater.downloadUpdate();
packageUpdated = true; packageUpdated = true;