Skip to content

Commit

Permalink
Merge branch 'pwa' into mod-pwa
Browse files Browse the repository at this point in the history
  • Loading branch information
microbit-matt-hillsdon committed May 29, 2024
2 parents 2ce4047 + 61213d2 commit 88a70d2
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,15 @@ if (flags.pwa) {
}
},
});
} else {
// Clean up if we've disabled the flag
if ("serviceWorker" in navigator) {
navigator.serviceWorker.getRegistration().then((registration) => {
registration?.unregister().then(() => {
window.location.reload();
});
});
}
}

const root = createRoot(document.getElementById("root")!);
Expand Down

0 comments on commit 88a70d2

Please sign in to comment.