File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ const app = electron.app
3
3
const Menu = electron . Menu
4
4
const ipc = electron . ipcMain
5
5
const GhReleases = require ( 'electron-gh-releases' )
6
+ const isDev = process . env . NODE_ENV !== 'production'
6
7
// electron.crashReporter.start()
7
8
var ipcServer = null
8
9
@@ -35,6 +36,10 @@ const updater = new GhReleases(ghReleasesOpts)
35
36
// Check for updates
36
37
// `status` returns true if there is a new update available
37
38
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
+ }
38
43
if ( process . platform === 'linux' || isUpdateReady ) {
39
44
return true
40
45
}
@@ -94,12 +99,12 @@ app.on('ready', function () {
94
99
95
100
// Check update every day
96
101
setInterval ( function ( ) {
97
- checkUpdate ( )
102
+ if ( ! isDev ) checkUpdate ( )
98
103
} , 1000 * 60 * 60 * 24 )
99
104
100
105
// Check update after 10 secs to prevent file locking of Windows
101
106
setTimeout ( ( ) => {
102
- checkUpdate ( )
107
+ if ( ! isDev ) checkUpdate ( )
103
108
104
109
ipc . on ( 'update-check' , function ( event , msg ) {
105
110
if ( isUpdateReady ) {
You can’t perform that action at this time.
0 commit comments