diff options
author | Bastien Wirtz <bastien.wirtz@gmail.com> | 2022-06-05 21:50:28 +0200 |
---|---|---|
committer | Bastien Wirtz <bastien.wirtz@gmail.com> | 2022-06-05 21:50:28 +0200 |
commit | 10f6f123e86ca571c99a232a43f7ea920fde9894 (patch) | |
tree | ac4470252002bc66911f9abf4d0128fbba537fbb /src/components | |
parent | e03e7592858b5018ea8f3eb9ab13bcf64cfb7a81 (diff) | |
download | homer-10f6f123e86ca571c99a232a43f7ea920fde9894.tar.gz homer-10f6f123e86ca571c99a232a43f7ea920fde9894.tar.zst homer-10f6f123e86ca571c99a232a43f7ea920fde9894.zip |
Lint run
Diffstat (limited to 'src/components')
-rw-r--r-- | src/components/ConnectivityChecker.vue | 11 |
1 files changed, 7 insertions, 4 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; |