Fix: SW controllerchange → Reload erzwingen bei SW-Update (stale api.js im Memory)
This commit is contained in:
parent
86dfe50013
commit
0438bd6bfe
2 changed files with 6 additions and 1 deletions
|
|
@ -224,6 +224,11 @@
|
|||
navigator.serviceWorker.register('/sw.js')
|
||||
.catch(err => console.log('SW Registration failed:', err));
|
||||
});
|
||||
// Wenn ein neuer SW die Kontrolle übernimmt (nach Update),
|
||||
// Seite neu laden — sonst hat app.js neue Seiten-JS aber altes api.js im Speicher.
|
||||
navigator.serviceWorker.addEventListener('controllerchange', () => {
|
||||
window.location.reload();
|
||||
});
|
||||
}
|
||||
</script>
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue