forked from extern/homer
Lint run
This commit is contained in:
parent
e03e759285
commit
10f6f123e8
@ -35,7 +35,7 @@ export default {
|
|||||||
window.addEventListener(
|
window.addEventListener(
|
||||||
"online",
|
"online",
|
||||||
function () {
|
function () {
|
||||||
that.checkOffline();
|
that.checkOffline();
|
||||||
},
|
},
|
||||||
false
|
false
|
||||||
);
|
);
|
||||||
@ -56,15 +56,18 @@ export default {
|
|||||||
|
|
||||||
// extra check to make sure we're not offline
|
// extra check to make sure we're not offline
|
||||||
let that = this;
|
let that = this;
|
||||||
const aliveCheckUrl = window.location.href + "?t="+(new Date().valueOf());
|
const aliveCheckUrl = window.location.href + "?t=" + new Date().valueOf();
|
||||||
return fetch(aliveCheckUrl, {
|
return fetch(aliveCheckUrl, {
|
||||||
method: "HEAD",
|
method: "HEAD",
|
||||||
cache: "no-store",
|
cache: "no-store",
|
||||||
redirect: "manual"
|
redirect: "manual",
|
||||||
})
|
})
|
||||||
.then(function (response) {
|
.then(function (response) {
|
||||||
// opaqueredirect means request has been redirected, to auth provider probably
|
// 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;
|
window.location.href = aliveCheckUrl;
|
||||||
}
|
}
|
||||||
that.offline = !response.ok;
|
that.offline = !response.ok;
|
||||||
|
@ -27,6 +27,6 @@ module.exports = {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
devServer: {
|
devServer: {
|
||||||
disableHostCheck: true
|
disableHostCheck: true,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user