Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Meta
create-react-app
Commits
15d8e53d
Commit
15d8e53d
authored
7 years ago
by
Kévin Dunglas
Committed by
Dan Abramov
7 years ago
Browse files
Options
Download
Email Patches
Plain Diff
Remove an useless negation in registerServiceWorker.js (#3150)
parent
70e0c08e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
packages/react-scripts/template/src/registerServiceWorker.js
+4
-4
packages/react-scripts/template/src/registerServiceWorker.js
with
4 additions
and
4 deletions
+4
-4
packages/react-scripts/template/src/registerServiceWorker.js
+
4
-
4
View file @
15d8e53d
...
@@ -32,12 +32,12 @@ export default function register() {
...
@@ -32,12 +32,12 @@ export default function register() {
window
.
addEventListener
(
'
load
'
,
()
=>
{
window
.
addEventListener
(
'
load
'
,
()
=>
{
const
swUrl
=
`
${
process
.
env
.
PUBLIC_URL
}
/service-worker.js`
;
const
swUrl
=
`
${
process
.
env
.
PUBLIC_URL
}
/service-worker.js`
;
if
(
!
isLocalhost
)
{
if
(
isLocalhost
)
{
// Is not local host. Just register service worker
registerValidSW
(
swUrl
);
}
else
{
// This is running on localhost. Lets check if a service worker still exists or not.
// This is running on localhost. Lets check if a service worker still exists or not.
checkValidServiceWorker
(
swUrl
);
checkValidServiceWorker
(
swUrl
);
}
else
{
// Is not local host. Just register service worker
registerValidSW
(
swUrl
);
}
}
});
});
}
}
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment