Skip to content

Commit

Permalink
Don't notify user of patch updates
Browse files Browse the repository at this point in the history
  • Loading branch information
morajabi committed Jun 5, 2018
1 parent 78564eb commit 255478a
Showing 1 changed file with 15 additions and 7 deletions.
22 changes: 15 additions & 7 deletions main/updates.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
const { app } = require('electron')
const autoUpdater = require('electron-updater').autoUpdater
const logger = require('electron-log')
const isDev = require('electron-is-dev')
const semver = require('semver')
const Raven = require('raven')
const ms = require('ms')

Expand Down Expand Up @@ -46,13 +48,19 @@ module.exports = () => {
})

autoUpdater.on('update-downloaded', ({ version }) => {
notify({
title: `Update to ${version || 'latest version'} is downloaded!`,
body: `Click to relaunch now! (Or we'll do it later)`,
onClick: () => {
autoUpdater.quitAndInstall()
},
})
const oldVersion = app.getVersion()
const diff = semver.diff(version, oldVersion)

// Don't notify user of patch updates
if (diff !== 'patch') {
notify({
title: `Update to ${version || 'latest version'} is downloaded!`,
body: `Click to relaunch now! (Or we'll do it later)`,
onClick: () => {
autoUpdater.quitAndInstall()
},
})
}

const user = getUser()

Expand Down

0 comments on commit 255478a

Please sign in to comment.