]> git.immae.eu Git - github/bastienwirtz/homer.git/blobdiff - src/components/ConnectivityChecker.vue
Lint run
[github/bastienwirtz/homer.git] / src / components / ConnectivityChecker.vue
index f2be6523c18822d586a5917a2b14ee3d092c2186..2b3e47b243adba523f5ade47f86cb2cf53d519b4 100644 (file)
@@ -35,7 +35,7 @@ export default {
     window.addEventListener(
       "online",
       function () {
-          that.checkOffline();
+        that.checkOffline();
       },
       false
     );
@@ -56,15 +56,18 @@ export default {
 
       // extra check to make sure we're not offline
       let that = this;
-      const aliveCheckUrl = window.location.href + "?t="+(new Date().valueOf());
+      const aliveCheckUrl = window.location.href + "?t=" + new Date().valueOf();
       return fetch(aliveCheckUrl, {
         method: "HEAD",
         cache: "no-store",
-        redirect: "manual"
+        redirect: "manual",
       })
         .then(function (response) {
           // opaqueredirect means request has been redirected, to auth provider probably
-          if ((response.type === "opaqueredirect" && !response.ok) || [401, 403].indexOf(response.status) != -1) {
+          if (
+            (response.type === "opaqueredirect" && !response.ok) ||
+            [401, 403].indexOf(response.status) != -1
+          ) {
             window.location.href = aliveCheckUrl;
           }
           that.offline = !response.ok;