Skip to content

Commit 9bd927f

Browse files
authored
Merge pull request #386 from vector-im/matthew/fix-updates
Don't check for updates if we already have one downloaded and queued
2 parents 389f6f4 + c23c3bd commit 9bd927f

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

src/updater.ts

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,19 @@ function installUpdate(): void {
2828

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

0 commit comments

Comments
 (0)