Skip to content

Commit

Permalink
fix(network): fix network availability detection #45
Browse files Browse the repository at this point in the history
  • Loading branch information
DEgITx committed Jul 17, 2018
1 parent 743b27b commit 5be36fa
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/background/checkInternet.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// https://stackoverflow.com/questions/15270902/check-for-internet-connectivity-in-nodejs
module.exports = function checkInternet(cb) {
require('dns').lookup('google.com',function(err) {
if (err && err.code == "ENOTFOUND") {
if (err && (err.code == "ENOTFOUND" || err.code == "EAI_AGAIN")) {
cb(false);
} else {
cb(true);
Expand Down

0 comments on commit 5be36fa

Please sign in to comment.