Skip to content

Commit

Permalink
Merge pull request #5 from johnbillion/patch-1
Browse files Browse the repository at this point in the history
Correctly report the lack of a `sent` value as a connection failure
  • Loading branch information
rey authored Nov 13, 2017
2 parents 4ee050e + 3f47ec1 commit 4ec608b
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion main.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,14 @@ palin.on("ready", function(){
var session = Ping.createSession (options);
session.pingHost (target, function (error) {

// If ping isn"t successful
// If ping isn't successful
if (error) {
appIcon.setToolTip("Internet is unavailable");
appIcon.setImage(__dirname + "/images/menu/dead@2x.png");
} else if ( ! sent ) {
console.log ("🍎 " + target + " count: " + count + " error: connection timed out");
appIcon.setToolTip("Internet is unavailable");
appIcon.setImage(__dirname + "/images/menu/dead@2x.png");
}

// Ping is successful!
Expand Down

0 comments on commit 4ec608b

Please sign in to comment.