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

Merge pull request #1393 from BoostIO/fix-update

Fix windows update
This commit is contained in:
Junyoung Choi (Sai)
2018-01-13 18:00:44 +09:00
committed by GitHub
3 changed files with 52 additions and 38 deletions

View File

@@ -65,14 +65,6 @@ updater.autoUpdater.on('error', (err) => {
console.log(err)
})
ipc.on('update-check', function (event, msg) {
if (isUpdateReady) {
mainWindow.webContents.send('update-ready', 'Update available!')
} else {
checkUpdate()
}
})
ipc.on('update-app-confirm', function (event, msg) {
if (isUpdateReady) {
mainWindow.removeAllListeners()
@@ -114,9 +106,20 @@ app.on('ready', function () {
// Check update every hour
setInterval(function () {
checkUpdate()
}, 1000 * 60 * 60)
}, 1000 * 60 * 60 * 24)
checkUpdate()
// Check update after 10 secs to prevent file locking of Windows
setTimeout(() => {
checkUpdate()
ipc.on('update-check', function (event, msg) {
if (isUpdateReady) {
mainWindow.webContents.send('update-ready', 'Update available!')
} else {
checkUpdate()
}
})
}, 10000)
ipcServer = require('./ipcServer')
ipcServer.server.start()
})