Skip to content

Commit

Permalink
serviceWorkerRegistration: Remove console.info which gets noisy in Pu…
Browse files Browse the repository at this point in the history
…ppeteer tests.
  • Loading branch information
raineorshine committed Apr 27, 2024
1 parent 1dfa09a commit d4bd629
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions src/serviceWorkerRegistration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,10 @@ export function register(config?: Config) {
// Add some additional logging to localhost, pointing developers to the
// service worker/PWA documentation.
navigator.serviceWorker.ready.then(() => {
console.info(
'This web app is being served cache-first by a service ' +
'worker. To learn more, visit https://cra.link/PWA',
)
// console.info(
// 'This web app is being served cache-first by a service ' +
// 'worker. To learn more, visit https://cra.link/PWA',
// )
})
} else {
// Is not localhost. Just register service worker
Expand All @@ -74,10 +74,10 @@ function registerValidSW(swUrl: string, config?: Config) {
// At this point, the updated precached content has been fetched,
// but the previous service worker will still serve the older
// content until all client tabs are closed.
console.info(
'New content is available and will be used when all ' +
'tabs for this page are closed. See https://cra.link/PWA.',
)
// console.info(
// 'New content is available and will be used when all ' +
// 'tabs for this page are closed. See https://cra.link/PWA.',
// )

// Execute callback
if (config && config.onUpdate) {
Expand All @@ -87,7 +87,7 @@ function registerValidSW(swUrl: string, config?: Config) {
// At this point, everything has been precached.
// It's the perfect time to display a
// "Content is cached for offline use." message.
console.info('Content is cached for offline use.')
// console.info('Content is cached for offline use.')

// Execute callback
if (config && config.onSuccess) {
Expand Down Expand Up @@ -125,7 +125,7 @@ function checkValidServiceWorker(swUrl: string, config?: Config) {
}
})
.catch(() => {
console.info('No internet connection found. App is running in offline mode.')
// console.info('No internet connection found. App is running in offline mode.')
})
}

Expand Down

0 comments on commit d4bd629

Please sign in to comment.