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

Merge pull request #2798 from MiloTodt/disable-updates-in-dev

Disable updates in dev
This commit is contained in:
Junyoung Choi
2019-01-23 13:03:14 +09:00
committed by GitHub

View File

@@ -3,6 +3,7 @@ const app = electron.app
const Menu = electron.Menu
const ipc = electron.ipcMain
const GhReleases = require('electron-gh-releases')
const isDev = process.env.NODE_ENV !== 'production'
// electron.crashReporter.start()
var ipcServer = null
@@ -35,6 +36,10 @@ const updater = new GhReleases(ghReleasesOpts)
// Check for updates
// `status` returns true if there is a new update available
function checkUpdate () {
if (isDev) { // Prevents app from attempting to update when in dev mode.
console.log('Updates are disabled in Development mode, see main-app.js')
return true
}
if (process.platform === 'linux' || isUpdateReady) {
return true
}
@@ -94,12 +99,12 @@ app.on('ready', function () {
// Check update every day
setInterval(function () {
checkUpdate()
if (!isDev) checkUpdate()
}, 1000 * 60 * 60 * 24)
// Check update after 10 secs to prevent file locking of Windows
setTimeout(() => {
checkUpdate()
if (!isDev) checkUpdate()
ipc.on('update-check', function (event, msg) {
if (isUpdateReady) {