aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorBastien Wirtz <bastien.wirtz@gmail.com>2022-06-05 21:50:28 +0200
committerBastien Wirtz <bastien.wirtz@gmail.com>2022-06-05 21:50:28 +0200
commit10f6f123e86ca571c99a232a43f7ea920fde9894 (patch)
treeac4470252002bc66911f9abf4d0128fbba537fbb
parente03e7592858b5018ea8f3eb9ab13bcf64cfb7a81 (diff)
downloadhomer-10f6f123e86ca571c99a232a43f7ea920fde9894.tar.gz
homer-10f6f123e86ca571c99a232a43f7ea920fde9894.tar.zst
homer-10f6f123e86ca571c99a232a43f7ea920fde9894.zip
Lint run
-rw-r--r--src/components/ConnectivityChecker.vue11
-rw-r--r--vue.config.js2
2 files changed, 8 insertions, 5 deletions
diff --git a/src/components/ConnectivityChecker.vue b/src/components/ConnectivityChecker.vue
index f2be652..2b3e47b 100644
--- a/src/components/ConnectivityChecker.vue
+++ b/src/components/ConnectivityChecker.vue
@@ -35,7 +35,7 @@ export default {
35 window.addEventListener( 35 window.addEventListener(
36 "online", 36 "online",
37 function () { 37 function () {
38 that.checkOffline(); 38 that.checkOffline();
39 }, 39 },
40 false 40 false
41 ); 41 );
@@ -56,15 +56,18 @@ export default {
56 56
57 // extra check to make sure we're not offline 57 // extra check to make sure we're not offline
58 let that = this; 58 let that = this;
59 const aliveCheckUrl = window.location.href + "?t="+(new Date().valueOf()); 59 const aliveCheckUrl = window.location.href + "?t=" + new Date().valueOf();
60 return fetch(aliveCheckUrl, { 60 return fetch(aliveCheckUrl, {
61 method: "HEAD", 61 method: "HEAD",
62 cache: "no-store", 62 cache: "no-store",
63 redirect: "manual" 63 redirect: "manual",
64 }) 64 })
65 .then(function (response) { 65 .then(function (response) {
66 // opaqueredirect means request has been redirected, to auth provider probably 66 // opaqueredirect means request has been redirected, to auth provider probably
67 if ((response.type === "opaqueredirect" && !response.ok) || [401, 403].indexOf(response.status) != -1) { 67 if (
68 (response.type === "opaqueredirect" && !response.ok) ||
69 [401, 403].indexOf(response.status) != -1
70 ) {
68 window.location.href = aliveCheckUrl; 71 window.location.href = aliveCheckUrl;
69 } 72 }
70 that.offline = !response.ok; 73 that.offline = !response.ok;
diff --git a/vue.config.js b/vue.config.js
index 1645c2f..82329d8 100644
--- a/vue.config.js
+++ b/vue.config.js
@@ -27,6 +27,6 @@ module.exports = {
27 }, 27 },
28 }, 28 },
29 devServer: { 29 devServer: {
30 disableHostCheck: true 30 disableHostCheck: true,
31 }, 31 },
32}; 32};