Skip to content

Commit

Permalink
update is-online
Browse files Browse the repository at this point in the history
is-online incorrectly reported the internet connection state, updating fixes this

callbacks are converted to promises
  • Loading branch information
davidferguson committed Mar 14, 2018
1 parent 5fd7ed6 commit ef00ec9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 16 deletions.
20 changes: 5 additions & 15 deletions app/pibakery.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
PiBakery - The easiest way to setup a Raspberry Pi
Copyright (C) 2016 David Ferguson
Copyright (C) 2016-2018 David Ferguson
This file is part of PiBakery.
Expand Down Expand Up @@ -183,10 +183,8 @@ function checkOs (data, i, cb) {
* @return null
*/
function fixBlocks () {
isOnline(function (error, online) {
if (error) {
console.error(error)
}
isOnline().then(function(online) {

var hider = document.createElement('div')
hider.setAttribute('id', 'hider')
document.body.appendChild(hider)
Expand Down Expand Up @@ -417,11 +415,7 @@ function checkForRaspbianUpdates (cb) {
function updateBlocks (src, downloadHash, newBlocksInfo, fixing) {
var writeDiv, title, writeAnimationDiv, writeAnimation, writeProgress

isOnline(function (error, online) {
if (error) {
console.error(error)
return
}
isOnline().then(function(online) {

if (! online) {
if (fixing) {
Expand Down Expand Up @@ -692,11 +686,7 @@ function updateRaspbian (osJsonInfo) {

var writeDiv, title, writeAnimationDiv, writeAnimation, writeProgress, writeDetailedProgress

isOnline(function (error, online) {
if (error) {
console.error(error)
return
}
isOnline().then(function(online) {

var hider = document.createElement('div')
hider.setAttribute('id', 'hider')
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"extract-zip": "^1.5.0",
"fs-extra": "^0.30.0",
"is-elevated": "^1.0.0",
"is-online": "^5.1.2",
"is-online": "^7.0.0",
"md5-file": "^3.1.1",
"node-df": "https://github.com/beeman/node-df/tarball/master",
"node-shell-parser": "^0.2.1",
Expand Down

0 comments on commit ef00ec9

Please sign in to comment.