seo improvement and updated notifs
This commit is contained in:
15
public/sw.js
15
public/sw.js
@@ -18,6 +18,21 @@ self.addEventListener('activate', (e) => {
|
||||
self.clients.claim()
|
||||
})
|
||||
|
||||
self.addEventListener('notificationclick', (e) => {
|
||||
e.notification.close()
|
||||
e.waitUntil(
|
||||
self.clients.matchAll({ type: 'window', includeUncontrolled: true }).then((clients) => {
|
||||
if (clients.length > 0) {
|
||||
const client = clients[0]
|
||||
client.focus()
|
||||
client.navigate('/')
|
||||
} else {
|
||||
self.clients.openWindow('/')
|
||||
}
|
||||
})
|
||||
)
|
||||
})
|
||||
|
||||
self.addEventListener('fetch', (e) => {
|
||||
// Only cache GET requests for same-origin non-API resources
|
||||
if (
|
||||
|
||||
Reference in New Issue
Block a user