Skip to content

Commit

Permalink
fix(updater): fix errors messages on updater if no internet connection
Browse files Browse the repository at this point in the history
  • Loading branch information
DEgITx committed Jul 12, 2018
1 parent 65e61c5 commit 6ec6609
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/background/background.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ const appConfig = require('./config')
const spiderCall = require('./spider')
const dbPatcher = require('./dbPatcher')
const startSphinx = require('./sphinx')
const checkInternet = require('./checkInternet')
const { changeLanguage } = require('../app/translation')

let mainWindow = undefined
Expand Down Expand Up @@ -218,7 +219,16 @@ app.on("ready", () => {
}
})

if (env.name === "production" && !portative) { autoUpdater.checkForUpdates() }
if (env.name === "production" && !portative) {
checkInternet(enabled => {
if(!enabled)
{
console.log('no internet connection were founded, updater not started')
return
}
autoUpdater.checkForUpdates()
})
}

spider = new spiderCall((...data) => {
if(mainWindow)
Expand Down

0 comments on commit 6ec6609

Please sign in to comment.