Skip to content

Commit

Permalink
Des-enregistre les serviceWorkers qui sont sur les anciennes url sans…
Browse files Browse the repository at this point in the history
… /jeu
  • Loading branch information
etienneCharignon authored and cprodhomme committed Oct 29, 2021
1 parent ff178fd commit 715b9a1
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/public/template_index.html
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,15 @@
<script type="text/javascript">
if ('serviceWorker' in navigator) {
window.addEventListener('load', () => {
['https://app.eva.beta.gouv.fr', 'https://preprod.eva.beta.gouv.fr'].forEach((scope) => {
navigator.serviceWorker.getRegistration(scope)
.then((registration) => {
registration.unregister();
})
.catch((err) => {
// on ignore volontairement les erreurs
});
});
navigator.serviceWorker.register('/jeu/service-worker.js').then(registration => {
console.log('SW registered: ', registration);
}).catch(registrationError => {
Expand Down

0 comments on commit 715b9a1

Please sign in to comment.