diff options
author | Bastien Wirtz <bastien.wirtz@gmail.com> | 2022-07-03 21:40:47 +0200 |
---|---|---|
committer | Bastien Wirtz <bastien.wirtz@gmail.com> | 2022-07-03 21:40:47 +0200 |
commit | b4207f27821617d83e4cf018c169ca3bac30fda1 (patch) | |
tree | afbb854e25521362571c34996bd357629838127c /src/registerServiceWorker.js | |
parent | c80854cb2d1e4ee0f96e8e5185b466b6c06c5416 (diff) | |
download | homer-b4207f27821617d83e4cf018c169ca3bac30fda1.tar.gz homer-b4207f27821617d83e4cf018c169ca3bac30fda1.tar.zst homer-b4207f27821617d83e4cf018c169ca3bac30fda1.zip |
new PWA implementation
Diffstat (limited to 'src/registerServiceWorker.js')
-rw-r--r-- | src/registerServiceWorker.js | 34 |
1 files changed, 0 insertions, 34 deletions
diff --git a/src/registerServiceWorker.js b/src/registerServiceWorker.js deleted file mode 100644 index 1473a0a..0000000 --- a/src/registerServiceWorker.js +++ /dev/null | |||
@@ -1,34 +0,0 @@ | |||
1 | /* eslint-disable no-console */ | ||
2 | |||
3 | import { register } from "register-service-worker"; | ||
4 | |||
5 | if (process.env.NODE_ENV === "production") { | ||
6 | register(`${process.env.BASE_URL}service-worker.js`, { | ||
7 | ready() { | ||
8 | console.log( | ||
9 | "App is being served from cache by a service worker.\n" + | ||
10 | "For more details, visit https://goo.gl/AFskqB" | ||
11 | ); | ||
12 | }, | ||
13 | registered() { | ||
14 | console.log("Service worker has been registered."); | ||
15 | }, | ||
16 | cached() { | ||
17 | console.log("Content has been cached for offline use."); | ||
18 | }, | ||
19 | updatefound() { | ||
20 | console.log("New content is downloading."); | ||
21 | }, | ||
22 | updated() { | ||
23 | console.log("New content is available; please refresh."); | ||
24 | }, | ||
25 | offline() { | ||
26 | console.log( | ||
27 | "No internet connection found. App is running in offline mode." | ||
28 | ); | ||
29 | }, | ||
30 | error(error) { | ||
31 | console.error("Error during service worker registration:", error); | ||
32 | }, | ||
33 | }); | ||
34 | } | ||