Skip to content

Commit c0f68dc

Browse files
authored
Merge pull request #2798 from MiloTodt/disable-updates-in-dev
Disable updates in dev
2 parents 2b6c380 + 667ece7 commit c0f68dc

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

lib/main-app.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ const app = electron.app
33
const Menu = electron.Menu
44
const ipc = electron.ipcMain
55
const GhReleases = require('electron-gh-releases')
6+
const isDev = process.env.NODE_ENV !== 'production'
67
// electron.crashReporter.start()
78
var ipcServer = null
89

@@ -35,6 +36,10 @@ const updater = new GhReleases(ghReleasesOpts)
3536
// Check for updates
3637
// `status` returns true if there is a new update available
3738
function checkUpdate () {
39+
if (isDev) { // Prevents app from attempting to update when in dev mode.
40+
console.log('Updates are disabled in Development mode, see main-app.js')
41+
return true
42+
}
3843
if (process.platform === 'linux' || isUpdateReady) {
3944
return true
4045
}
@@ -94,12 +99,12 @@ app.on('ready', function () {
9499

95100
// Check update every day
96101
setInterval(function () {
97-
checkUpdate()
102+
if (!isDev) checkUpdate()
98103
}, 1000 * 60 * 60 * 24)
99104

100105
// Check update after 10 secs to prevent file locking of Windows
101106
setTimeout(() => {
102-
checkUpdate()
107+
if (!isDev) checkUpdate()
103108

104109
ipc.on('update-check', function (event, msg) {
105110
if (isUpdateReady) {

0 commit comments

Comments
 (0)