1
0
mirror of https://github.com/BoostIo/Boostnote synced 2025-12-13 09:46:22 +00:00

fix update error

This commit is contained in:
Dick Choi
2016-09-21 16:00:18 +09:00
parent 8a9d4df6c7
commit 6bb9366ec8
2 changed files with 17 additions and 1 deletions

View File

@@ -44,7 +44,7 @@ const updater = new GhReleases(ghReleasesOpts)
// Check for updates
// `status` returns true if there is a new update available
function checkUpdate () {
if (process.platform === 'linux') {
if (process.platform === 'linux' || isUpdateReady) {
return true
}
updater.check((err, status) => {
@@ -54,6 +54,7 @@ function checkUpdate () {
return
}
if (status) {
mainWindow.webContents.send('update-found', 'Update available!')
updater.download()
}
})
@@ -69,6 +70,7 @@ updater.on('update-downloaded', (info) => {
ipc.on('update-app-confirm', function (event, msg) {
console.log('confirmed')
if (isUpdateReady) {
mainWindow.removeAllListeners()
updater.install()
}
})