Remove an useless negation in registerServiceWorker.js (#3150)

This commit is contained in:
Kévin Dunglas
2017-10-28 23:01:24 +02:00
committed by Dan Abramov
parent 70e0c08ef7
commit 15d8e53daf

View File

@@ -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);
}
});
}