client.navigate
Deploy frontend / frontend (push) Successful in 1m3s

This commit is contained in:
2024-12-02 19:13:08 +02:00
parent 7b5cfebe80
commit 4f85aa0f98
+19 -18
View File
@@ -114,6 +114,7 @@ self.addEventListener('notificationclick', (event) => {
])
}
}
if (clients.openWindow) {
console.log('open new window', urlToOpen)
@@ -121,15 +122,15 @@ self.addEventListener('notificationclick', (event) => {
if (!client) {
console.log('new window not opened')
for (const client of clientList) {
client.postMessage({
type: 'notificationClick',
url: urlToOpen,
tag: event.notification.tag,
payload: event.notification.payload,
matchUrl: false,
msg: 'new window not opened',
})
break
return client.navigate(urlToOpen)
// return client.postMessage({
// type: 'notificationClick',
// url: urlToOpen,
// tag: event.notification.tag,
// payload: event.notification.payload,
// matchUrl: false,
// msg: 'new window not opened',
// })
}
}
})
@@ -137,15 +138,15 @@ self.addEventListener('notificationclick', (event) => {
console.log('clients.openWindow not available')
for (const client of clientList) {
client.postMessage({
type: 'notificationClick',
url: urlToOpen,
tag: event.notification.tag,
payload: event.notification.payload,
matchUrl: false,
msg: 'clients.openWindow not available',
})
break
return client.navigate(urlToOpen)
// return client.postMessage({
// type: 'notificationClick',
// url: urlToOpen,
// tag: event.notification.tag,
// payload: event.notification.payload,
// matchUrl: false,
// msg: 'clients.openWindow not available',
// })
}
}
})