Skip to content

Commit

Permalink
Trigger SW
Browse files Browse the repository at this point in the history
  • Loading branch information
Sami JABER committed Jan 21, 2025
1 parent 483b45d commit 250c09d
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions services/webapp/src/serviceWorkerRegistration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ function registerValidSW(swUrl: string, config?: Config) {
installingWorker.onstatechange = () => {
if (installingWorker.state === 'installed') {
if (navigator.serviceWorker.controller) {
// force reload
navigator.serviceWorker.addEventListener('controllerchange', () => {
window.location.reload(); // Reload the current page
});
Expand Down

0 comments on commit 250c09d

Please sign in to comment.