Skip to content

Commit 22120b1

Browse files
dunglasgaearon
authored andcommitted
Remove an useless negation in registerServiceWorker.js (facebook#3150)
1 parent 540a145 commit 22120b1

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

template/src/registerServiceWorker.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,12 @@ export default function register() {
3232
window.addEventListener('load', () => {
3333
const swUrl = `${process.env.PUBLIC_URL}/service-worker.js`;
3434

35-
if (!isLocalhost) {
36-
// Is not local host. Just register service worker
37-
registerValidSW(swUrl);
38-
} else {
35+
if (isLocalhost) {
3936
// This is running on localhost. Lets check if a service worker still exists or not.
4037
checkValidServiceWorker(swUrl);
38+
} else {
39+
// Is not local host. Just register service worker
40+
registerValidSW(swUrl);
4141
}
4242
});
4343
}

0 commit comments

Comments
 (0)