diff options
Diffstat (limited to 'src/components/ConnectivityChecker.vue')
-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; |