We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Learn more about funding links in repositories.
Report abuse
There was an error while loading. Please reload this page.
1 parent 70e0c08 commit 15d8e53Copy full SHA for 15d8e53
packages/react-scripts/template/src/registerServiceWorker.js
@@ -32,12 +32,12 @@ export default function register() {
32
window.addEventListener('load', () => {
33
const swUrl = `${process.env.PUBLIC_URL}/service-worker.js`;
34
35
- if (!isLocalhost) {
36
- // Is not local host. Just register service worker
37
- registerValidSW(swUrl);
38
- } else {
+ if (isLocalhost) {
39
// This is running on localhost. Lets check if a service worker still exists or not.
40
checkValidServiceWorker(swUrl);
+ } else {
+ // Is not local host. Just register service worker
+ registerValidSW(swUrl);
41
}
42
});
43
0 commit comments