mirror of
https://github.com/GiriNeko/YesPlayMusic.git
synced 2025-12-17 13:48:02 +00:00
fix: PWA issue
This commit is contained in:
parent
0adae696cf
commit
4b2d5a2b3c
1 changed files with 28 additions and 33 deletions
|
|
@ -2,36 +2,31 @@
|
||||||
|
|
||||||
import { register } from "register-service-worker";
|
import { register } from "register-service-worker";
|
||||||
|
|
||||||
if (
|
register(`${process.env.BASE_URL}service-worker.js`, {
|
||||||
process.env.NODE_ENV === "production" &&
|
ready() {
|
||||||
process.env.IS_ELECTRON === "undefined"
|
console.log(
|
||||||
) {
|
"App is being served from cache by a service worker.\n" +
|
||||||
register(`${process.env.BASE_URL}service-worker.js`, {
|
"For more details, visit https://goo.gl/AFskqB"
|
||||||
ready() {
|
);
|
||||||
console.log(
|
},
|
||||||
"App is being served from cache by a service worker.\n" +
|
registered() {
|
||||||
"For more details, visit https://goo.gl/AFskqB"
|
console.log("Service worker has been registered.");
|
||||||
);
|
},
|
||||||
},
|
cached() {
|
||||||
registered() {
|
console.log("Content has been cached for offline use.");
|
||||||
console.log("Service worker has been registered.");
|
},
|
||||||
},
|
updatefound() {
|
||||||
cached() {
|
console.log("New content is downloading.");
|
||||||
console.log("Content has been cached for offline use.");
|
},
|
||||||
},
|
updated() {
|
||||||
updatefound() {
|
console.log("New content is available; please refresh.");
|
||||||
console.log("New content is downloading.");
|
},
|
||||||
},
|
offline() {
|
||||||
updated() {
|
console.log(
|
||||||
console.log("New content is available; please refresh.");
|
"No internet connection found. App is running in offline mode."
|
||||||
},
|
);
|
||||||
offline() {
|
},
|
||||||
console.log(
|
error(error) {
|
||||||
"No internet connection found. App is running in offline mode."
|
console.error("Error during service worker registration:", error);
|
||||||
);
|
},
|
||||||
},
|
});
|
||||||
error(error) {
|
|
||||||
console.error("Error during service worker registration:", error);
|
|
||||||
},
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue