1
0
mirror of https://github.com/kremalicious/portfolio.git synced 2024-12-22 09:13:19 +01:00
portfolio/public/sw.js
Matthias Kretschmann 7eb0075e6f
Migrate to Biome (#1322)
* migrate to Biome

* package updates

* ci fix

* typing fix
2024-07-26 11:45:20 +01:00

14 lines
333 B
JavaScript

// https://github.com/NekR/self-destroying-sw
self.addEventListener('install', (e) => {
self.skipWaiting()
})
self.addEventListener('activate', (e) => {
self.registration
.unregister()
.then(() => self.clients.matchAll())
.then((clients) => {
clients.forEach((client) => client.navigate(client.url))
})
})