Skip to content
This repository has been archived by the owner on Mar 7, 2023. It is now read-only.

Commit

Permalink
fix(sw): update exp 10
Browse files Browse the repository at this point in the history
  • Loading branch information
rhahao authored May 14, 2022
1 parent f0e06a6 commit 0a524a3
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/serviceWorkerRegistration.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,10 @@ function registerValidSW(swUrl, config) {
.then((registration) => {
registration.onupdatefound = () => {
const installingWorker = registration.installing;

if (installingWorker) {
installingWorker.onstatechange = () => {
console.log(installingWorker.state);
if (installingWorker.state === 'installed') {
const waitingWorker = registration.waiting;
if (waitingWorker) {
Expand Down

0 comments on commit 0a524a3

Please sign in to comment.