Skip to content

Commit

Permalink
Merge pull request #386 from vector-im/matthew/fix-updates
Browse files Browse the repository at this point in the history
Don't check for updates if we already have one downloaded and queued
  • Loading branch information
ara4n authored Jul 4, 2022
2 parents 389f6f4 + c23c3bd commit 9bd927f
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion src/updater.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,19 @@ function installUpdate(): void {

function pollForUpdates(): void {
try {
autoUpdater.checkForUpdates();
// If we've already got a new update downloaded, then stop
// trying to check for new ones, as according to the doc
// at https://github.com/electron/electron/blob/main/docs/api/auto-updater.md#autoupdatercheckforupdates
// we'll just keep re-downloading the same update.
// As a hunch, this might also be causing
// https://github.com/vector-im/element-web/issues/12433
// due to the update checks colliding with the pending install
// somehow
if (!latestUpdateDownloaded) {
autoUpdater.checkForUpdates();
} else {
console.log("Skipping update check as download already present");
}
} catch (e) {
console.log('Couldn\'t check for update', e);
}
Expand Down

0 comments on commit 9bd927f

Please sign in to comment.