We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 20ba6f5 commit 4775d61Copy full SHA for 4775d61
src/registerServiceWorker.js
@@ -34,6 +34,9 @@ if (process.env.NODE_ENV === "production") {
34
console.log(
35
"No internet connection found. App is running in offline mode."
36
);
37
+ document.dispatchEvent(
38
+ new CustomEvent("sw-status", { detail: "offline" })
39
+ );
40
},
41
error(error) {
42
console.error("Error during service worker registration:", error);
src/store/client.js
@@ -97,6 +97,9 @@ const actions = {
97
commit("updateError", "");
98
99
swUpdate: ({ commit }, type) => {
100
+ if (type == "offline") {
101
+ commit("updateError", "Picto is offline.");
102
+ }
103
commit("swUpdate", type);
104
}
105
};
0 commit comments