Skip to content

Commit

Permalink
Add SW Information
Browse files Browse the repository at this point in the history
  • Loading branch information
Sami JABER committed Jan 21, 2025
1 parent b9f52ca commit e7e0ec7
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions services/webapp/src/serviceWorkerRegistration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ function registerValidSW(swUrl: string, config?: Config) {
.register(swUrl)
.then(registration => {
registration.onupdatefound = () => {
console.log('On Update Found executed, lets handle ');
if (registration.waiting) {
console.log('New service worker is waiting, skipping ......');
registration.waiting.postMessage({ type: 'SKIP_WAITING' });
Expand All @@ -80,6 +81,7 @@ function registerValidSW(swUrl: string, config?: Config) {
return;
}
installingWorker.onstatechange = () => {
console.log('OnStage changed ' + installingWorker.state);
if (installingWorker.state === 'installed') {
if (navigator.serviceWorker.controller) {
// At this point, the updated precached content has been fetched,
Expand Down

0 comments on commit e7e0ec7

Please sign in to comment.