Skip to content
This repository has been archived by the owner on Oct 4, 2023. It is now read-only.

Commit

Permalink
[C-838] Avoid sending auto update when only patch
Browse files Browse the repository at this point in the history
  • Loading branch information
raymondjacobson committed Aug 16, 2022
1 parent e215be3 commit 1195fa9
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion packages/web/src/electron.js
Original file line number Diff line number Diff line change
Expand Up @@ -478,7 +478,15 @@ autoUpdater.on('update-downloaded', (info) => {
autoUpdater.on('update-available', (info) => {
console.log('update-available', info)
info.currentVersion = autoUpdater.currentVersion.version
if (mainWindow) mainWindow.webContents.send('updateAvailable', info)
const sameMajorAndMinor =
semver.major(info.currentVersion) === semver.major(info.version) &&
semver.minor(info.currentVersion) === semver.minor(info.version)

if (!sameMajorAndMinor && mainWindow) {
// Display an update available UI in the case that a non-patch version is
// available. Otherwise, result to install on quit.
mainWindow.webContents.send('updateAvailable', info)
}
})

autoUpdater.on('download-progress', (info) => {
Expand Down

0 comments on commit 1195fa9

Please sign in to comment.