From 87bbb4fbe4a2e75fc80faf8e346a9f9e9c17f334 Mon Sep 17 00:00:00 2001 From: Alexey Kasyanchuk Date: Tue, 17 Jul 2018 12:18:30 +0300 Subject: [PATCH] fix(network): fix network availability detection #45 --- src/background/checkInternet.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/background/checkInternet.js b/src/background/checkInternet.js index abe4f89..db1924e 100644 --- a/src/background/checkInternet.js +++ b/src/background/checkInternet.js @@ -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);