mirror of
https://github.com/zhigang1992/create-react-app.git
synced 2026-03-29 00:18:13 +08:00
Remove an useless negation in registerServiceWorker.js (#3150)
This commit is contained in:
committed by
Dan Abramov
parent
70e0c08ef7
commit
15d8e53daf
@@ -32,12 +32,12 @@ export default function register() {
|
||||
window.addEventListener('load', () => {
|
||||
const swUrl = `${process.env.PUBLIC_URL}/service-worker.js`;
|
||||
|
||||
if (!isLocalhost) {
|
||||
// Is not local host. Just register service worker
|
||||
registerValidSW(swUrl);
|
||||
} else {
|
||||
if (isLocalhost) {
|
||||
// This is running on localhost. Lets check if a service worker still exists or not.
|
||||
checkValidServiceWorker(swUrl);
|
||||
} else {
|
||||
// Is not local host. Just register service worker
|
||||
registerValidSW(swUrl);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user