2 <div v-if="offline" class="offline-message">
3 <i class="far fa-dizzy"></i>
6 <span @click="checkOffline"> <i class="fas fa-redo-alt"></i></span>
13 name: "ConnectivityChecker",
19 created: function () {
23 document.addEventListener(
26 if (document.visibilityState == "visible") {
32 window.addEventListener(
39 window.addEventListener(
48 checkOffline: function () {
49 if (!navigator.onLine) {
54 // extra check to make sure we're not offline
56 return fetch(window.location.href + "?alive", {
61 .then(function (response) {
62 // opaqueredirect means request has been redirected, to auth provider probably
63 if (response.type === "opaqueredirect" && !response.ok) {
64 window.location.reload(true);
66 that.offline = !response.ok;
71 .finally(function () {
72 that.$emit("network-status-update", that.offline);