]> git.immae.eu Git - github/bastienwirtz/homer.git/commitdiff
Simplify the connectivity checker
authorBastien Wirtz <bastien.wirtz@gmail.com>
Wed, 14 Jul 2021 14:41:00 +0000 (16:41 +0200)
committerBastien Wirtz <bastien.wirtz@gmail.com>
Wed, 14 Jul 2021 14:41:00 +0000 (16:41 +0200)
src/components/ConnectivityChecker.vue

index 7302e1f56a5ea91504c62e506736b3337a3aa752..02cbd7fcd4c45d58888cc8f99bb88e00661c18c3 100644 (file)
@@ -38,11 +38,7 @@ export default {
         cache: "no-store",
       })
         .then(function (response) {
-          if (response.status >= 200 && response.status < 300) {
-            that.offline = false;
-          } else {
-            that.offline = true;
-          }
+          that.offline = !response.ok;
         })
         .catch(function () {
           that.offline = true;