Skip to content

Commit 02bd775

Browse files
committed
Change names
1 parent 8234f76 commit 02bd775

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

packages/app/src/app/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ requirePolyfills().then(() => {
7979
});
8080

8181
registerServiceWorker('/service-worker.js', {
82-
onUpdate: () => {
82+
onUpdated: () => {
8383
controller.getSignal('setUpdateStatus')({ status: 'available' });
8484
},
8585
onInstalled: () => {

packages/common/registerServiceWorker.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ const isLocalhost = Boolean(
2020

2121
const isHttp = Boolean(window.location.protocol === 'http:');
2222

23-
export default function register(swUrl, { onUpdate, onInstalled }) {
23+
export default function register(swUrl, { onUpdated, onInstalled }) {
2424
if (process.env.NODE_ENV === 'production' && 'serviceWorker' in navigator) {
2525
// The URL constructor is available in all browsers that support SW.
2626
const publicUrl = new URL(process.env.PUBLIC_URL, window.location);
@@ -34,7 +34,7 @@ export default function register(swUrl, { onUpdate, onInstalled }) {
3434
window.addEventListener('load', () => {
3535
if (!isLocalhost && !isHttp) {
3636
// It's neither localhost nor http. Just register service worker
37-
registerValidSW(swUrl, { onUpdate, onInstalled });
37+
registerValidSW(swUrl, { onUpdated, onInstalled });
3838
} else if (isLocalhost) {
3939
// This is running on localhost. Lets check if a service worker still exists or not.
4040
checkValidServiceWorker(swUrl);
@@ -43,7 +43,7 @@ export default function register(swUrl, { onUpdate, onInstalled }) {
4343
}
4444
}
4545

46-
function registerValidSW(swUrl, { onUpdate, onInstalled }) {
46+
function registerValidSW(swUrl, { onUpdated, onInstalled }) {
4747
navigator.serviceWorker
4848
.register(swUrl)
4949
.then(registration => {
@@ -56,8 +56,8 @@ function registerValidSW(swUrl, { onUpdate, onInstalled }) {
5656
// the fresh content will have been added to the cache.
5757
// It's the perfect time to display a "New content is
5858
// available; please refresh." message in your web app.
59-
if (onUpdate) {
60-
onUpdate();
59+
if (onUpdated) {
60+
onUpdated();
6161
}
6262
} else {
6363
// At this point, everything has been precached.

0 commit comments

Comments
 (0)